qrdx 0.0.1
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/README.md +414 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +11 -0
- package/dist/index.mjs.map +1 -0
- package/dist/src/api.d.ts +3 -0
- package/dist/src/api.d.ts.map +1 -0
- package/dist/src/codegen.d.ts +101 -0
- package/dist/src/codegen.d.ts.map +1 -0
- package/dist/src/constants.d.ts +15 -0
- package/dist/src/constants.d.ts.map +1 -0
- package/dist/src/corner-dot.d.ts +4 -0
- package/dist/src/corner-dot.d.ts.map +1 -0
- package/dist/src/corner-eye.d.ts +3 -0
- package/dist/src/corner-eye.d.ts.map +1 -0
- package/dist/src/detection.d.ts +13 -0
- package/dist/src/detection.d.ts.map +1 -0
- package/dist/src/download.d.ts +36 -0
- package/dist/src/download.d.ts.map +1 -0
- package/dist/src/helpers.d.ts +36 -0
- package/dist/src/helpers.d.ts.map +1 -0
- package/dist/src/index.d.ts +25 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/qr-code.d.ts +20 -0
- package/dist/src/qr-code.d.ts.map +1 -0
- package/dist/src/template/arrow.d.ts +3 -0
- package/dist/src/template/arrow.d.ts.map +1 -0
- package/dist/src/template/default.d.ts +3 -0
- package/dist/src/template/default.d.ts.map +1 -0
- package/dist/src/template/halloween.d.ts +3 -0
- package/dist/src/template/halloween.d.ts.map +1 -0
- package/dist/src/template/index.d.ts +7 -0
- package/dist/src/template/index.d.ts.map +1 -0
- package/dist/src/template/square-border.d.ts +3 -0
- package/dist/src/template/square-border.d.ts.map +1 -0
- package/dist/src/template/standard-box.d.ts +3 -0
- package/dist/src/template/standard-box.d.ts.map +1 -0
- package/dist/src/template/striked-box.d.ts +3 -0
- package/dist/src/template/striked-box.d.ts.map +1 -0
- package/dist/src/templates.d.ts +8 -0
- package/dist/src/templates.d.ts.map +1 -0
- package/dist/src/utils.d.ts +38 -0
- package/dist/src/utils.d.ts.map +1 -0
- package/dist/types/common.d.ts +9 -0
- package/dist/types/common.d.ts.map +1 -0
- package/dist/types/corner-dot.d.ts +3 -0
- package/dist/types/corner-dot.d.ts.map +1 -0
- package/dist/types/corner-eye.d.ts +3 -0
- package/dist/types/corner-eye.d.ts.map +1 -0
- package/dist/types/image-pattern.d.ts +3 -0
- package/dist/types/image-pattern.d.ts.map +1 -0
- package/dist/types/index.d.ts +10 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/qr.d.ts +35 -0
- package/dist/types/qr.d.ts.map +1 -0
- package/dist/types/template.d.ts +34 -0
- package/dist/types/template.d.ts.map +1 -0
- package/package.json +51 -0
- package/src/api.tsx +85 -0
- package/src/codegen.ts +1043 -0
- package/src/constants.ts +26 -0
- package/src/corner-dot.tsx +101 -0
- package/src/corner-eye.ts +165 -0
- package/src/detection.ts +266 -0
- package/src/download.tsx +235 -0
- package/src/helpers.ts +59 -0
- package/src/index.tsx +306 -0
- package/src/qr-code.tsx +116 -0
- package/src/template/arrow.tsx +39 -0
- package/src/template/default.tsx +26 -0
- package/src/template/halloween.tsx +146 -0
- package/src/template/index.ts +6 -0
- package/src/template/square-border.tsx +42 -0
- package/src/template/standard-box.tsx +42 -0
- package/src/template/striked-box.tsx +41 -0
- package/src/templates.tsx +32 -0
- package/src/utils.tsx +750 -0
- package/types/common.ts +4 -0
- package/types/corner-dot.ts +13 -0
- package/types/corner-eye.ts +13 -0
- package/types/image-pattern.ts +12 -0
- package/types/index.ts +16 -0
- package/types/qr.ts +41 -0
- package/types/template.ts +41 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/api.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAY3C,wBAAsB,UAAU,CAAC,KAAK,EAAE,UAAU,wCAwEjD"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license QR Code generator library (TypeScript)
|
|
3
|
+
* Copyright (c) Project Nayuki.
|
|
4
|
+
* SPDX-License-Identifier: MIT
|
|
5
|
+
*/
|
|
6
|
+
declare namespace qrcodegen {
|
|
7
|
+
type bit = number;
|
|
8
|
+
type byte = number;
|
|
9
|
+
type int = number;
|
|
10
|
+
export class QrCode {
|
|
11
|
+
readonly version: int;
|
|
12
|
+
readonly errorCorrectionLevel: QrCode.Ecc;
|
|
13
|
+
static encodeText(text: string, ecl: QrCode.Ecc): QrCode;
|
|
14
|
+
static encodeBinary(data: Readonly<Array<byte>>, ecl: QrCode.Ecc): QrCode;
|
|
15
|
+
static encodeSegments(segs: Readonly<Array<QrSegment>>, ecl: QrCode.Ecc, minVersion?: int, maxVersion?: int, mask?: int, boostEcl?: boolean): QrCode;
|
|
16
|
+
readonly size: int;
|
|
17
|
+
readonly mask: int;
|
|
18
|
+
private readonly modules;
|
|
19
|
+
private readonly isFunction;
|
|
20
|
+
constructor(version: int, errorCorrectionLevel: QrCode.Ecc, dataCodewords: Readonly<Array<byte>>, msk: int);
|
|
21
|
+
getModule(x: int, y: int): boolean;
|
|
22
|
+
getModules(): boolean[][];
|
|
23
|
+
private drawFunctionPatterns;
|
|
24
|
+
private drawFormatBits;
|
|
25
|
+
private drawVersion;
|
|
26
|
+
private drawFinderPattern;
|
|
27
|
+
private drawAlignmentPattern;
|
|
28
|
+
private setFunctionModule;
|
|
29
|
+
private addEccAndInterleave;
|
|
30
|
+
private drawCodewords;
|
|
31
|
+
private applyMask;
|
|
32
|
+
private getPenaltyScore;
|
|
33
|
+
private getAlignmentPatternPositions;
|
|
34
|
+
private static getNumRawDataModules;
|
|
35
|
+
private static getNumDataCodewords;
|
|
36
|
+
private static reedSolomonComputeDivisor;
|
|
37
|
+
private static reedSolomonComputeRemainder;
|
|
38
|
+
private static reedSolomonMultiply;
|
|
39
|
+
private finderPenaltyCountPatterns;
|
|
40
|
+
private finderPenaltyTerminateAndCount;
|
|
41
|
+
private finderPenaltyAddHistory;
|
|
42
|
+
static readonly MIN_VERSION: int;
|
|
43
|
+
static readonly MAX_VERSION: int;
|
|
44
|
+
private static readonly PENALTY_N1;
|
|
45
|
+
private static readonly PENALTY_N2;
|
|
46
|
+
private static readonly PENALTY_N3;
|
|
47
|
+
private static readonly PENALTY_N4;
|
|
48
|
+
private static readonly ECC_CODEWORDS_PER_BLOCK;
|
|
49
|
+
private static readonly NUM_ERROR_CORRECTION_BLOCKS;
|
|
50
|
+
}
|
|
51
|
+
export class QrSegment {
|
|
52
|
+
readonly mode: QrSegment.Mode;
|
|
53
|
+
readonly numChars: int;
|
|
54
|
+
private readonly bitData;
|
|
55
|
+
static makeBytes(data: Readonly<Array<byte>>): QrSegment;
|
|
56
|
+
static makeNumeric(digits: string): QrSegment;
|
|
57
|
+
static makeAlphanumeric(text: string): QrSegment;
|
|
58
|
+
static makeSegments(text: string): Array<QrSegment>;
|
|
59
|
+
static makeEci(assignVal: int): QrSegment;
|
|
60
|
+
static isNumeric(text: string): boolean;
|
|
61
|
+
static isAlphanumeric(text: string): boolean;
|
|
62
|
+
constructor(mode: QrSegment.Mode, numChars: int, bitData: Array<bit>);
|
|
63
|
+
getData(): Array<bit>;
|
|
64
|
+
static getTotalBits(segs: Readonly<Array<QrSegment>>, version: int): number;
|
|
65
|
+
private static toUtf8ByteArray;
|
|
66
|
+
private static readonly NUMERIC_REGEX;
|
|
67
|
+
private static readonly ALPHANUMERIC_REGEX;
|
|
68
|
+
private static readonly ALPHANUMERIC_CHARSET;
|
|
69
|
+
}
|
|
70
|
+
export {};
|
|
71
|
+
}
|
|
72
|
+
declare namespace qrcodegen.QrCode {
|
|
73
|
+
type int = number;
|
|
74
|
+
export class Ecc {
|
|
75
|
+
readonly ordinal: int;
|
|
76
|
+
readonly formatBits: int;
|
|
77
|
+
static readonly LOW: Ecc;
|
|
78
|
+
static readonly MEDIUM: Ecc;
|
|
79
|
+
static readonly QUARTILE: Ecc;
|
|
80
|
+
static readonly HIGH: Ecc;
|
|
81
|
+
private constructor();
|
|
82
|
+
}
|
|
83
|
+
export {};
|
|
84
|
+
}
|
|
85
|
+
declare namespace qrcodegen.QrSegment {
|
|
86
|
+
type int = number;
|
|
87
|
+
export class Mode {
|
|
88
|
+
readonly modeBits: int;
|
|
89
|
+
private readonly numBitsCharCount;
|
|
90
|
+
static readonly NUMERIC: Mode;
|
|
91
|
+
static readonly ALPHANUMERIC: Mode;
|
|
92
|
+
static readonly BYTE: Mode;
|
|
93
|
+
static readonly KANJI: Mode;
|
|
94
|
+
static readonly ECI: Mode;
|
|
95
|
+
private constructor();
|
|
96
|
+
numCharCountBits(ver: int): int;
|
|
97
|
+
}
|
|
98
|
+
export {};
|
|
99
|
+
}
|
|
100
|
+
export default qrcodegen;
|
|
101
|
+
//# sourceMappingURL=codegen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codegen.d.ts","sourceRoot":"","sources":["../../src/codegen.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,kBAAU,SAAS,CAAC;IAClB,KAAK,GAAG,GAAG,MAAM,CAAC;IAClB,KAAK,IAAI,GAAG,MAAM,CAAC;IACnB,KAAK,GAAG,GAAG,MAAM,CAAC;IAoBlB,MAAM,OAAO,MAAM;iBAoJC,OAAO,EAAE,GAAG;iBAGZ,oBAAoB,EAAE,MAAM,CAAC,GAAG;eA/IpC,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC,GAAG,GAAG,MAAM;eASjD,YAAY,CACxB,IAAI,EAAE,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,EAC3B,GAAG,EAAE,MAAM,CAAC,GAAG,GACd,MAAM;eAgBK,cAAc,CAC1B,IAAI,EAAE,QAAQ,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,EAChC,GAAG,EAAE,MAAM,CAAC,GAAG,EACf,UAAU,GAAE,GAAO,EACnB,UAAU,GAAE,GAA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AAM,CAAC,QAAQ,CAAC,oBAAoB,CACM;KACnD;;CACF;AAID,kBAAU,SAAS,CAAC,MAAM,CAAC;IACzB,KAAK,GAAG,GAAG,MAAM,CAAC;IAKlB,MAAM,OAAO,GAAG;iBAYI,OAAO,EAAE,GAAG;iBAEZ,UAAU,EAAE,GAAG;QAXjC,gBAAuB,GAAG,MAAiB;QAC3C,gBAAuB,MAAM,MAAiB;QAC9C,gBAAuB,QAAQ,MAAiB;QAChD,gBAAuB,IAAI,MAAiB;QAI5C,OAAO;KAMR;;CACF;AAID,kBAAU,SAAS,CAAC,SAAS,CAAC;IAC5B,KAAK,GAAG,GAAG,MAAM,CAAC;IAKlB,MAAM,OAAO,IAAI;iBAaG,QAAQ,EAAE,GAAG;QAE7B,OAAO,CAAC,QAAQ,CAAC,gBAAgB;QAZnC,gBAAuB,OAAO,OAA+B;QAC7D,gBAAuB,YAAY,OAA8B;QACjE,gBAAuB,IAAI,OAA8B;QACzD,gBAAuB,KAAK,OAA8B;QAC1D,gBAAuB,GAAG,OAA4B;QAItD,OAAO;QAWA,gBAAgB,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG;KAGvC;;CACF;AAGD,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import qrcodegen from "./codegen";
|
|
2
|
+
export declare const ERROR_LEVEL_MAP: {
|
|
3
|
+
[index: string]: qrcodegen.QrCode.Ecc;
|
|
4
|
+
};
|
|
5
|
+
export declare const DEFAULT_SIZE = 128;
|
|
6
|
+
export declare const DEFAULT_LEVEL = "Q";
|
|
7
|
+
export declare const DEFAULT_BGCOLOR = "#FFFFFF";
|
|
8
|
+
export declare const DEFAULT_FGCOLOR = "#000000";
|
|
9
|
+
export declare const DEFAULT_EYECOLOR = "#000000";
|
|
10
|
+
export declare const DEFAULT_DOTCOLOR = "#000000";
|
|
11
|
+
export declare const DEFAULT_MARGIN = 0;
|
|
12
|
+
export declare const QR_LEVELS: readonly ["L", "M", "Q", "H"];
|
|
13
|
+
export declare const DEFAULT_IMG_SCALE = 0.1;
|
|
14
|
+
export declare const FLAM_QR_LOGO = "https://instant.flamapp.ai/flogo-qr.svg";
|
|
15
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,WAAW,CAAC;AAElC,eAAO,MAAM,eAAe,EAAE;IAAE,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC,GAAG,CAAA;CAKpE,CAAC;AAEF,eAAO,MAAM,YAAY,MAAM,CAAC;AAChC,eAAO,MAAM,aAAa,MAAM,CAAC;AACjC,eAAO,MAAM,eAAe,YAAY,CAAC;AACzC,eAAO,MAAM,eAAe,YAAY,CAAC;AACzC,eAAO,MAAM,gBAAgB,YAAY,CAAC;AAC1C,eAAO,MAAM,gBAAgB,YAAY,CAAC;AAC1C,eAAO,MAAM,cAAc,IAAI,CAAC;AAEhC,eAAO,MAAM,SAAS,+BAAgC,CAAC;AAMvD,eAAO,MAAM,iBAAiB,MAAM,CAAC;AAErC,eAAO,MAAM,YAAY,4CAA4C,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { JSX } from "react";
|
|
2
|
+
import type { CornerEyeDotPattern } from "../types/corner-dot";
|
|
3
|
+
export declare function generateCornerDotPath(cx: number, cy: number, radius: number, pattern?: CornerEyeDotPattern): JSX.Element;
|
|
4
|
+
//# sourceMappingURL=corner-dot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"corner-dot.d.ts","sourceRoot":"","sources":["../../src/corner-dot.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAG/D,wBAAgB,qBAAqB,CACnC,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EACV,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,mBAA8B,GACtC,GAAG,CAAC,OAAO,CA2Fb"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"corner-eye.d.ts","sourceRoot":"","sources":["../../src/corner-eye.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AA0I5D,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,gBAAyB,GACjC,MAAM,CAqBR"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Downloads the processed image data as a PNG file
|
|
3
|
+
*/
|
|
4
|
+
export declare const downloadImageData: (imageData: ImageData, width: number, height: number, filename: string) => void;
|
|
5
|
+
export declare const handleImageLoad: (uploadedImage: HTMLImageElement, _size: number, returnFullData?: boolean) => Promise<any>;
|
|
6
|
+
/**
|
|
7
|
+
* Downloads the original image with a bounding box around the QR code
|
|
8
|
+
*/
|
|
9
|
+
export declare function downloadImageWithBoundingBox(imgElement: HTMLImageElement, boundingBox: {
|
|
10
|
+
x: number;
|
|
11
|
+
y: number;
|
|
12
|
+
}[], filename: string): void;
|
|
13
|
+
//# sourceMappingURL=detection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detection.d.ts","sourceRoot":"","sources":["../../src/detection.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAC5B,WAAW,SAAS,EACpB,OAAO,MAAM,EACb,QAAQ,MAAM,EACd,UAAU,MAAM,SA6BjB,CAAC;AAuHF,eAAO,MAAM,eAAe,GAC1B,eAAe,gBAAgB,EAC/B,OAAO,MAAM,EACb,wBAAsB,iBA2CvB,CAAC;AAEF;;GAEG;AACH,wBAAgB,4BAA4B,CAC1C,UAAU,EAAE,gBAAgB,EAC5B,WAAW,EAAE;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,EAAE,EACvC,QAAQ,EAAE,MAAM,QAsDjB"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { QRProps } from "../types";
|
|
2
|
+
export type DownloadFormat = "png" | "jpg" | "svg";
|
|
3
|
+
export type DownloadSize = {
|
|
4
|
+
width: number;
|
|
5
|
+
height: number;
|
|
6
|
+
};
|
|
7
|
+
export declare const PRESET_SIZES: Record<string, DownloadSize>;
|
|
8
|
+
export type DownloadOptions = {
|
|
9
|
+
format: DownloadFormat;
|
|
10
|
+
size: DownloadSize;
|
|
11
|
+
filename?: string;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Validates if a size value is within acceptable bounds
|
|
15
|
+
*/
|
|
16
|
+
export declare function validateSize(width: number, height: number): {
|
|
17
|
+
isValid: boolean;
|
|
18
|
+
error?: string;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Downloads a QR code with the specified options
|
|
22
|
+
*/
|
|
23
|
+
export declare function downloadQRCode(qrProps: QRProps, options: DownloadOptions): Promise<void>;
|
|
24
|
+
/**
|
|
25
|
+
* Gets a QR code as a data URL for preview or other purposes
|
|
26
|
+
*/
|
|
27
|
+
export declare function getQRCodeDataUrl(qrProps: QRProps, format: DownloadFormat, size: DownloadSize): Promise<string>;
|
|
28
|
+
/**
|
|
29
|
+
* Copies QR code to clipboard (works best with PNG format)
|
|
30
|
+
*/
|
|
31
|
+
export declare function copyQRCodeToClipboard(qrProps: QRProps, size?: DownloadSize): Promise<void>;
|
|
32
|
+
/**
|
|
33
|
+
* Gets SVG content as string (useful for copying SVG code)
|
|
34
|
+
*/
|
|
35
|
+
export declare function getSVGString(qrProps: QRProps): Promise<string>;
|
|
36
|
+
//# sourceMappingURL=download.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"download.d.ts","sourceRoot":"","sources":["../../src/download.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAIxC,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,KAAK,GAAG,KAAK,CAAC;AAEnD,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAOrD,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,EAAE,cAAc,CAAC;IACvB,IAAI,EAAE,YAAY,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF;;GAEG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,GACb;IACD,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CA0BA;AAqCD;;GAEG;AACH,wBAAsB,cAAc,CAClC,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,eAAe,GACvB,OAAO,CAAC,IAAI,CAAC,CAqCf;AAED;;GAEG;AACH,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,YAAY,GACjB,OAAO,CAAC,MAAM,CAAC,CAyBjB;AAED;;GAEG;AACH,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,OAAO,EAChB,IAAI,GAAE,YAA4D,GACjE,OAAO,CAAC,IAAI,CAAC,CA2Cf;AAED;;GAEG;AACH,wBAAsB,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAGpE"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { BodyPattern, CornerEyeDotPattern, CornerEyePattern } from "@/types";
|
|
2
|
+
export declare function getQRData({ url, fgColor, bgColor, eyeColor, dotColor, bodyPattern, hideLogo, logo, margin, cornerEyePattern, cornerEyeDotPattern, level, templateId, }: {
|
|
3
|
+
url: string;
|
|
4
|
+
fgColor?: string;
|
|
5
|
+
bgColor?: string;
|
|
6
|
+
eyeColor?: string;
|
|
7
|
+
dotColor?: string;
|
|
8
|
+
bodyPattern?: BodyPattern;
|
|
9
|
+
hideLogo?: boolean;
|
|
10
|
+
logo?: string;
|
|
11
|
+
margin?: number;
|
|
12
|
+
cornerEyePattern?: CornerEyePattern;
|
|
13
|
+
cornerEyeDotPattern?: CornerEyeDotPattern;
|
|
14
|
+
level?: "L" | "M" | "Q" | "H";
|
|
15
|
+
templateId?: string;
|
|
16
|
+
}): {
|
|
17
|
+
imageSettings?: {
|
|
18
|
+
src: string;
|
|
19
|
+
height: number;
|
|
20
|
+
width: number;
|
|
21
|
+
excavate: boolean;
|
|
22
|
+
} | undefined;
|
|
23
|
+
value: string;
|
|
24
|
+
bgColor: string | undefined;
|
|
25
|
+
fgColor: string | undefined;
|
|
26
|
+
eyeColor: string | undefined;
|
|
27
|
+
dotColor: string | undefined;
|
|
28
|
+
bodyPattern: "square" | "rounded" | "circle" | "diamond" | "circle-large" | "circle-mixed" | "pacman" | "clean-square" | undefined;
|
|
29
|
+
cornerEyePattern: "square" | "rounded" | "rounded-inward" | "rounded-inward-flipped" | "gear" | "semi-round" | "rounded-extra" | "rounded-square" | "circle" | undefined;
|
|
30
|
+
cornerEyeDotPattern: "square" | "rounded-inward" | "rounded-inward-flipped" | "semi-round" | "rounded-square" | "circle" | "leaf" | "diamond" | "diamond-rounded" | undefined;
|
|
31
|
+
level: "L" | "M" | "Q" | "H" | undefined;
|
|
32
|
+
templateId: string | undefined;
|
|
33
|
+
size: number;
|
|
34
|
+
margin: number | undefined;
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,mBAAmB,EACnB,gBAAgB,EACjB,MAAM,SAAS,CAAC;AAGjB,wBAAgB,SAAS,CAAC,EACxB,GAAG,EACH,OAAO,EACP,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,QAAQ,EACR,IAAI,EACJ,MAAM,EACN,gBAAgB,EAChB,mBAAmB,EACnB,KAAK,EACL,UAAU,GACX,EAAE;IACD,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,KAAK,CAAC,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;;;;;;;;;;;;;;;;;;;EAuBA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** biome-ignore-all lint/performance/noBarrelFile: false positive */
|
|
2
|
+
/** biome-ignore-all lint/style/noMagicNumbers: false positive */
|
|
3
|
+
/** biome-ignore-all lint/correctness/useImageSize: false positive */
|
|
4
|
+
/** biome-ignore-all lint/a11y/noNoninteractiveElementInteractions: false positive */
|
|
5
|
+
/** biome-ignore-all lint/performance/noImgElement: false positive */
|
|
6
|
+
/** biome-ignore-all lint/complexity/noExcessiveCognitiveComplexity: false positive */
|
|
7
|
+
/**
|
|
8
|
+
* @license qrcode.react
|
|
9
|
+
* Copyright (c) Paul O'Shannessy
|
|
10
|
+
* SPDX-License-Identifier: ISC
|
|
11
|
+
*/
|
|
12
|
+
import { type JSX } from "react";
|
|
13
|
+
import type { QRProps, QRPropsCanvas } from "../types";
|
|
14
|
+
export * from "../types";
|
|
15
|
+
export * from "./api";
|
|
16
|
+
export * from "./detection";
|
|
17
|
+
export * from "./download";
|
|
18
|
+
export * from "./qr-code";
|
|
19
|
+
export * from "./templates";
|
|
20
|
+
export * from "./utils";
|
|
21
|
+
export declare function QRCodeCanvas(props: QRPropsCanvas): JSX.Element;
|
|
22
|
+
export declare function getQRAsSVGDataUri(props: QRProps): Promise<string>;
|
|
23
|
+
export declare function getQRAsCanvas(props: QRProps, type: string, getCanvas?: boolean): Promise<HTMLCanvasElement | string>;
|
|
24
|
+
export { getQRData } from "./helpers";
|
|
25
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,iEAAiE;AACjE,qEAAqE;AACrE,qFAAqF;AACrF,qEAAqE;AACrE,sFAAsF;AAEtF;;;;GAIG;AACH,OAAO,EAAE,KAAK,GAAG,EAA+B,MAAM,OAAO,CAAC;AAC9D,OAAO,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAiBvD,cAAc,UAAU,CAAC;AACzB,cAAc,OAAO,CAAC;AACtB,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AAExB,wBAAgB,YAAY,CAAC,KAAK,EAAE,aAAa,eA6HhD;AAED,wBAAsB,iBAAiB,CAAC,KAAK,EAAE,OAAO,mBA4CrD;AAwCD,wBAAsB,aAAa,CACjC,KAAK,EAAE,OAAO,EACd,IAAI,EAAE,MAAM,EACZ,SAAS,CAAC,EAAE,OAAO,GAClB,OAAO,CAAC,iBAAiB,GAAG,MAAM,CAAC,CAkDrC;AAED,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { BodyPattern, CornerEyeDotPattern, CornerEyePattern, TemplateDefinition } from "@/types";
|
|
2
|
+
export declare const QRCode: import("react").MemoExoticComponent<({ url, fgColor, hideLogo, logo, bgColor, eyeColor, dotColor, bodyPattern, cornerEyePattern, cornerEyeDotPattern, level, scale, margin, templateId, customTemplate, customProps, }: {
|
|
3
|
+
url: string;
|
|
4
|
+
fgColor?: string;
|
|
5
|
+
hideLogo?: boolean;
|
|
6
|
+
logo?: string;
|
|
7
|
+
bgColor?: string;
|
|
8
|
+
eyeColor?: string;
|
|
9
|
+
dotColor?: string;
|
|
10
|
+
bodyPattern?: BodyPattern;
|
|
11
|
+
cornerEyePattern?: CornerEyePattern;
|
|
12
|
+
cornerEyeDotPattern?: CornerEyeDotPattern;
|
|
13
|
+
level?: "L" | "M" | "Q" | "H";
|
|
14
|
+
scale?: number;
|
|
15
|
+
margin?: number;
|
|
16
|
+
templateId?: string;
|
|
17
|
+
customTemplate?: TemplateDefinition<any>;
|
|
18
|
+
customProps?: Record<string, any>;
|
|
19
|
+
}) => import("react").JSX.Element>;
|
|
20
|
+
//# sourceMappingURL=qr-code.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"qr-code.d.ts","sourceRoot":"","sources":["../../src/qr-code.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,WAAW,EACX,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,EACnB,MAAM,SAAS,CAAC;AAKjB,eAAO,MAAM,MAAM,0NAkBd;IACD,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,KAAK,CAAC,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,kBAAkB,CAAC,GAAG,CAAC,CAAC;IACzC,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACnC,iCAiEF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"arrow.d.ts","sourceRoot":"","sources":["../../../src/template/arrow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEtD,eAAO,MAAM,KAAK,EAAE,kBAoCnB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../../src/template/default.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEtD,eAAO,MAAM,eAAe,EAAE,kBAuB7B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"halloween.d.ts","sourceRoot":"","sources":["../../../src/template/halloween.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEtD,eAAO,MAAM,SAAS,EAAE,kBA+IvB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/template/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"square-border.d.ts","sourceRoot":"","sources":["../../../src/template/square-border.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEtD,eAAO,MAAM,YAAY,EAAE,kBAuC1B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"standard-box.d.ts","sourceRoot":"","sources":["../../../src/template/standard-box.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEtD,eAAO,MAAM,WAAW,EAAE,kBAuCzB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"striked-box.d.ts","sourceRoot":"","sources":["../../../src/template/striked-box.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEtD,eAAO,MAAM,UAAU,EAAE,kBAsCxB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { TemplateDefinition } from "../types";
|
|
2
|
+
export type { BaseTemplateProps, TemplateConfig, TemplateDefinition, } from "../types";
|
|
3
|
+
export * from "./template";
|
|
4
|
+
export declare const TEMPLATES: Record<string, TemplateDefinition<any>>;
|
|
5
|
+
export declare const getTemplate: (templateId: string) => TemplateDefinition<any> | undefined;
|
|
6
|
+
export declare const getAllTemplates: () => TemplateDefinition<any>[];
|
|
7
|
+
export declare const getTemplateIds: () => string[];
|
|
8
|
+
//# sourceMappingURL=templates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../src/templates.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAInD,YAAY,EACV,iBAAiB,EACjB,cAAc,EACd,kBAAkB,GACnB,MAAM,UAAU,CAAC;AAGlB,cAAc,YAAY,CAAC;AAG3B,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,GAAG,CAAC,CAO7D,CAAC;AAGF,eAAO,MAAM,WAAW,GACtB,YAAY,MAAM,KACjB,kBAAkB,CAAC,GAAG,CAAC,GAAG,SAAkC,CAAC;AAEhE,eAAO,MAAM,eAAe,QAAO,kBAAkB,CAAC,GAAG,CAAC,EAChC,CAAC;AAE3B,eAAO,MAAM,cAAc,QAAO,MAAM,EAA4B,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { JSX } from "react";
|
|
2
|
+
import type { Excavation, ImageSettings, Modules, QRPropsSVG } from "../types";
|
|
3
|
+
export declare function excavateModules(modules: Modules, excavation: Excavation): Modules;
|
|
4
|
+
export declare function generatePath(modules: Modules, margin?: number): string;
|
|
5
|
+
export declare function getImageSettings(cells: Modules, size: number, _margin: number, imageSettings?: ImageSettings): null | {
|
|
6
|
+
x: number;
|
|
7
|
+
y: number;
|
|
8
|
+
h: number;
|
|
9
|
+
w: number;
|
|
10
|
+
excavation: Excavation | null;
|
|
11
|
+
};
|
|
12
|
+
export declare function convertImageSettingsToPixels(calculatedImageSettings: {
|
|
13
|
+
x: number;
|
|
14
|
+
y: number;
|
|
15
|
+
w: number;
|
|
16
|
+
h: number;
|
|
17
|
+
excavation: Excavation | null;
|
|
18
|
+
}, size: number, numCells: number, margin: number): {
|
|
19
|
+
imgWidth: number;
|
|
20
|
+
imgHeight: number;
|
|
21
|
+
imgLeft: number;
|
|
22
|
+
imgTop: number;
|
|
23
|
+
};
|
|
24
|
+
export declare function QRCodeSVG(props: QRPropsSVG): JSX.Element;
|
|
25
|
+
export declare const SUPPORTS_PATH2D: boolean;
|
|
26
|
+
export declare const hexToRgb: (hex: string) => {
|
|
27
|
+
r: number;
|
|
28
|
+
g: number;
|
|
29
|
+
b: number;
|
|
30
|
+
} | null;
|
|
31
|
+
export declare const getLuminance: (r: number, g: number, b: number) => number;
|
|
32
|
+
export declare const getContrastRatio: (color1: string, color2: string) => number;
|
|
33
|
+
export declare const getContrastLevel: (ratio: number) => {
|
|
34
|
+
level: string;
|
|
35
|
+
warning: boolean;
|
|
36
|
+
message: string;
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAGjC,OAAO,KAAK,EAEV,UAAU,EACV,aAAa,EACb,OAAO,EACP,UAAU,EACX,MAAM,UAAU,CAAC;AAiBlB,wBAAgB,eAAe,CAC7B,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,UAAU,GACrB,OAAO,CAYT;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAI,GAAG,MAAM,CA0CjE;AA2LD,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,OAAO,EACd,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,aAAa,CAAC,EAAE,aAAa,GAC5B,IAAI,GAAG;IACR,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,UAAU,EAAE,UAAU,GAAG,IAAI,CAAC;CAC/B,CA2BA;AAED,wBAAgB,4BAA4B,CAC1C,u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A;CAAE,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const CORNER_EYE_DOT_PATTERNS: readonly ["square", "rounded-square", "circle", "rounded-inward", "rounded-inward-flipped", "semi-round", "leaf", "diamond", "diamond-rounded"];
|
|
2
|
+
export type CornerEyeDotPattern = (typeof CORNER_EYE_DOT_PATTERNS)[number];
|
|
3
|
+
//# sourceMappingURL=corner-dot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"corner-dot.d.ts","sourceRoot":"","sources":["../../types/corner-dot.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,uBAAuB,iJAU1B,CAAC;AAEX,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,CAAC,CAAC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const CORNER_EYE_PATTERNS: readonly ["square", "rounded", "rounded-inward", "rounded-inward-flipped", "gear", "semi-round", "rounded-extra", "rounded-square", "circle"];
|
|
2
|
+
export type CornerEyePattern = (typeof CORNER_EYE_PATTERNS)[number];
|
|
3
|
+
//# sourceMappingURL=corner-eye.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"corner-eye.d.ts","sourceRoot":"","sources":["../../types/corner-eye.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,+IAUtB,CAAC;AAEX,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image-pattern.d.ts","sourceRoot":"","sources":["../../types/image-pattern.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,+GASf,CAAC;AAEX,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type { Excavation, Modules } from "./common";
|
|
2
|
+
export type { CornerEyeDotPattern } from "./corner-dot";
|
|
3
|
+
export { CORNER_EYE_DOT_PATTERNS } from "./corner-dot";
|
|
4
|
+
export type { CornerEyePattern } from "./corner-eye";
|
|
5
|
+
export { CORNER_EYE_PATTERNS } from "./corner-eye";
|
|
6
|
+
export type { BodyPattern } from "./image-pattern";
|
|
7
|
+
export { BODY_PATTERN } from "./image-pattern";
|
|
8
|
+
export type { ImageSettings, QRProps, QRPropsCanvas, QRPropsSVG, } from "./qr";
|
|
9
|
+
export type { BaseTemplateProps, TemplateConfig, TemplateDefinition } from "./template";
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../types/index.ts"],"names":[],"mappings":"AAEA,YAAY,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACpD,YAAY,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AACvD,YAAY,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,YAAY,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,YAAY,EACV,aAAa,EACb,OAAO,EACP,aAAa,EACb,UAAU,GACX,MAAM,MAAM,CAAC;AACd,YAAY,EAAE,iBAAiB,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { CSSProperties } from "react";
|
|
2
|
+
import type { CornerEyeDotPattern } from "./corner-dot";
|
|
3
|
+
import type { CornerEyePattern } from "./corner-eye";
|
|
4
|
+
import type { BodyPattern } from "./image-pattern";
|
|
5
|
+
import type { TemplateDefinition } from "./template";
|
|
6
|
+
export type ImageSettings = {
|
|
7
|
+
src: string;
|
|
8
|
+
height: number;
|
|
9
|
+
width: number;
|
|
10
|
+
excavate: boolean;
|
|
11
|
+
x?: number;
|
|
12
|
+
y?: number;
|
|
13
|
+
};
|
|
14
|
+
export type QRProps = {
|
|
15
|
+
value: string;
|
|
16
|
+
size?: number;
|
|
17
|
+
level?: string;
|
|
18
|
+
bgColor?: string;
|
|
19
|
+
fgColor?: string;
|
|
20
|
+
eyeColor?: string;
|
|
21
|
+
dotColor?: string;
|
|
22
|
+
bodyPattern?: BodyPattern;
|
|
23
|
+
cornerEyePattern?: CornerEyePattern;
|
|
24
|
+
cornerEyeDotPattern?: CornerEyeDotPattern;
|
|
25
|
+
margin?: number;
|
|
26
|
+
style?: CSSProperties;
|
|
27
|
+
imageSettings?: ImageSettings;
|
|
28
|
+
isOGContext?: boolean;
|
|
29
|
+
templateId?: string;
|
|
30
|
+
customTemplate?: TemplateDefinition<any>;
|
|
31
|
+
customProps?: Record<string, any>;
|
|
32
|
+
};
|
|
33
|
+
export type QRPropsCanvas = QRProps & React.CanvasHTMLAttributes<HTMLCanvasElement>;
|
|
34
|
+
export type QRPropsSVG = QRProps & React.SVGProps<SVGSVGElement>;
|
|
35
|
+
//# sourceMappingURL=qr.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"qr.d.ts","sourceRoot":"","sources":["../../types/qr.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAErD,MAAM,MAAM,aAAa,GAAG;IAC1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
* Configuration object passed to template wrappers containing all QR code metadata.
|
|
7
|
+
* All dimension values are in the template coordinate space (typically 300x300).
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* wrapper: (children, config, props) => {
|
|
12
|
+
* // Use pixelSize to calculate decorative element sizes
|
|
13
|
+
* const decorativeRadius = config.pixelSize * 0.5;
|
|
14
|
+
*
|
|
15
|
+
* // Use qrSize to determine QR complexity
|
|
16
|
+
* if (config.qrSize > 40) {
|
|
17
|
+
* // Adjust template for high-density QR codes
|
|
18
|
+
* }
|
|
19
|
+
*
|
|
20
|
+
* return <svg>...</svg>;
|
|
21
|
+
* }
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export type TemplateConfig = {
|
|
25
|
+
pixelSize: number;
|
|
26
|
+
url: string;
|
|
27
|
+
};
|
|
28
|
+
export type TemplateDefinition<TCustomProps = Record<string, never>> = {
|
|
29
|
+
id: string;
|
|
30
|
+
name: string;
|
|
31
|
+
description?: string;
|
|
32
|
+
wrapper: (children: React.ReactNode, props?: BaseTemplateProps & TCustomProps, templateConfig?: TemplateConfig) => React.ReactNode;
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=template.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"template.d.ts","sourceRoot":"","sources":["../../types/template.ts"],"names":[],"mappings":"AACA,MAAM,MAAM,iBAAiB,GAAG;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAGF,MAAM,MAAM,kBAAkB,CAAC,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI;IACrE,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,CACP,QAAQ,EAAE,KAAK,CAAC,SAAS,EACzB,KAAK,CAAC,EAAE,iBAAiB,GAAG,YAAY,EACxC,cAAc,CAAC,EAAE,cAAc,KAC5B,KAAK,CAAC,SAAS,CAAC;CACtB,CAAC"}
|