@liquid-js/qr-code-styling 1.6.0-rc.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.
@@ -0,0 +1,171 @@
1
+ /// <reference types="node" />
2
+ import { browserImageTools } from "../tools/browserImageTools";
3
+ export interface UnknownObject {
4
+ [key: string]: any;
5
+ }
6
+ export declare enum DotType {
7
+ dots = "dots",
8
+ rounded = "rounded",
9
+ classy = "classy",
10
+ classyRounded = "classy-rounded",
11
+ square = "square",
12
+ extraRounded = "extra-rounded"
13
+ }
14
+ export declare enum CornerDotType {
15
+ dot = "dot",
16
+ square = "square"
17
+ }
18
+ export declare enum CornerSquareType {
19
+ dot = "dot",
20
+ square = "square",
21
+ extraRounded = "extra-rounded"
22
+ }
23
+ export declare enum GradientType {
24
+ radial = "radial",
25
+ linear = "linear"
26
+ }
27
+ export declare enum ShapeType {
28
+ square = "square",
29
+ circle = "circle"
30
+ }
31
+ export declare type Gradient = {
32
+ type: GradientType;
33
+ rotation?: number;
34
+ colorStops: {
35
+ offset: number;
36
+ color: string;
37
+ }[];
38
+ };
39
+ declare type TypeNumber = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40;
40
+ declare const TypeNumber: {
41
+ 0: 0;
42
+ 1: 1;
43
+ 2: 2;
44
+ 3: 3;
45
+ 4: 4;
46
+ 5: 5;
47
+ 6: 6;
48
+ 7: 7;
49
+ 8: 8;
50
+ 9: 9;
51
+ 10: 10;
52
+ 11: 11;
53
+ 12: 12;
54
+ 13: 13;
55
+ 14: 14;
56
+ 15: 15;
57
+ 16: 16;
58
+ 17: 17;
59
+ 18: 18;
60
+ 19: 19;
61
+ 20: 20;
62
+ 21: 21;
63
+ 22: 22;
64
+ 23: 23;
65
+ 24: 24;
66
+ 25: 25;
67
+ 26: 26;
68
+ 27: 27;
69
+ 28: 28;
70
+ 29: 29;
71
+ 30: 30;
72
+ 31: 31;
73
+ 32: 32;
74
+ 33: 33;
75
+ 34: 34;
76
+ 35: 35;
77
+ 36: 36;
78
+ 37: 37;
79
+ 38: 38;
80
+ 39: 39;
81
+ 40: 40;
82
+ };
83
+ export { TypeNumber };
84
+ export declare enum ErrorCorrectionLevel {
85
+ L = "L",
86
+ M = "M",
87
+ Q = "Q",
88
+ H = "H"
89
+ }
90
+ export declare enum Mode {
91
+ numeric = "Numeric",
92
+ alphanumeric = "Alphanumeric",
93
+ byte = "Byte",
94
+ kanji = "Kanji"
95
+ }
96
+ export interface QRCode {
97
+ addData(data: string, mode?: Mode): void;
98
+ make(): void;
99
+ getModuleCount(): number;
100
+ isDark(row: number, col: number): boolean;
101
+ }
102
+ export declare type Options = {
103
+ document?: Document;
104
+ shape?: ShapeType;
105
+ width?: number;
106
+ height?: number;
107
+ margin?: number;
108
+ data?: string;
109
+ image?: string | Buffer | Blob;
110
+ imageTools?: typeof browserImageTools;
111
+ qrOptions?: {
112
+ typeNumber?: TypeNumber;
113
+ mode?: Mode;
114
+ errorCorrectionLevel?: ErrorCorrectionLevel;
115
+ };
116
+ imageOptions?: {
117
+ hideBackgroundDots?: boolean;
118
+ imageSize?: number;
119
+ crossOrigin?: string;
120
+ margin?: number;
121
+ };
122
+ dotsOptions?: {
123
+ type?: DotType;
124
+ color?: string;
125
+ gradient?: Gradient;
126
+ };
127
+ cornersSquareOptions?: {
128
+ type?: CornerSquareType;
129
+ color?: string;
130
+ gradient?: Gradient;
131
+ };
132
+ cornersDotOptions?: {
133
+ type?: CornerDotType;
134
+ color?: string;
135
+ gradient?: Gradient;
136
+ };
137
+ backgroundOptions?: {
138
+ round?: number;
139
+ color?: string;
140
+ gradient?: Gradient;
141
+ } | false;
142
+ };
143
+ export declare type FilterFunction = (i: number, j: number) => boolean;
144
+ export declare type DrawArgs = {
145
+ x: number;
146
+ y: number;
147
+ size: number;
148
+ rotation?: number;
149
+ getNeighbor?: GetNeighbor;
150
+ };
151
+ export declare type BasicFigureDrawArgs = {
152
+ x: number;
153
+ y: number;
154
+ size: number;
155
+ rotation?: number;
156
+ };
157
+ export declare type RotateFigureArgs = {
158
+ x: number;
159
+ y: number;
160
+ size: number;
161
+ rotation?: number;
162
+ draw: () => void;
163
+ };
164
+ export declare type GetNeighbor = (x: number, y: number) => boolean;
165
+ export declare type ExtensionFunction = (svg: SVGElement, options: Options) => void;
166
+ export declare enum FileExtension {
167
+ svg = "svg",
168
+ png = "png",
169
+ jpeg = "jpeg",
170
+ webp = "webp"
171
+ }
package/package.json ADDED
@@ -0,0 +1,80 @@
1
+ {
2
+ "name": "@liquid-js/qr-code-styling",
3
+ "version": "1.6.0-rc.1",
4
+ "description": "Add a style and an image to your QR code",
5
+ "main": "lib/qr-code-styling-node.js",
6
+ "browser": "lib/qr-code-styling-node.js",
7
+ "types": "lib/index.d.ts",
8
+ "files": [
9
+ "lib"
10
+ ],
11
+ "dependencies": {
12
+ "file-type": "<17.0.0",
13
+ "jsdom": "^19.0.0",
14
+ "node-fetch": "<3.0.0",
15
+ "qrcode-generator": "^1.4.4",
16
+ "sharp": "^0.30.4"
17
+ },
18
+ "devDependencies": {
19
+ "@rollup/plugin-commonjs": "^22.0.0",
20
+ "@rollup/plugin-typescript": "^8.3.2",
21
+ "@types/jsdom": "^16.2.14",
22
+ "@types/node": "^17.0.31",
23
+ "@types/node-fetch": "^2.6.1",
24
+ "@types/sharp": "^0.30.2",
25
+ "@typescript-eslint/eslint-plugin": "^5.22.0",
26
+ "@typescript-eslint/parser": "^5.22.0",
27
+ "canvas": "^2.9.1",
28
+ "clean-webpack-plugin": "^4.0.0",
29
+ "eslint": "^8.14.0",
30
+ "eslint-config-prettier": "^8.5.0",
31
+ "eslint-plugin-jest": "^26.1.5",
32
+ "eslint-plugin-prettier": "^4.0.0",
33
+ "eslint-webpack-plugin": "^3.1.1",
34
+ "html-webpack-plugin": "^5.5.0",
35
+ "jest": "^28.0.3",
36
+ "jest-environment-jsdom": "^28.0.2",
37
+ "prettier": "^2.6.2",
38
+ "rollup": "^2.72.0",
39
+ "ts-jest": "^28.0.1",
40
+ "ts-loader": "^9.3.0",
41
+ "typescript": "^4.6.4",
42
+ "webpack": "^5.72.0",
43
+ "webpack-cli": "^4.9.2",
44
+ "webpack-dev-server": "^4.9.0",
45
+ "webpack-merge": "^5.8.0"
46
+ },
47
+ "scripts": {
48
+ "build": "webpack --mode=production --config webpack.config.build.js && rollup -c rollup.config.js",
49
+ "build:dev": "webpack --mode=development --config webpack.config.build.js",
50
+ "test": "jest",
51
+ "start": "webpack serve --open --config webpack.config.dev-server.js",
52
+ "lint": "eslint . --fix"
53
+ },
54
+ "repository": {
55
+ "type": "git",
56
+ "url": "git+https://github.com/kozakdenys/qr-code-styling.git"
57
+ },
58
+ "keywords": [
59
+ "qr",
60
+ "qrcode",
61
+ "qr-code",
62
+ "js",
63
+ "qrjs",
64
+ "qrstyling",
65
+ "styling",
66
+ "qrbranding",
67
+ "branding",
68
+ "qrimage",
69
+ "image",
70
+ "qrlogo",
71
+ "logo",
72
+ "design"
73
+ ],
74
+ "author": "Denys Kozak <kozak.denys.dev@gmail.com>",
75
+ "license": "MIT",
76
+ "bugs": {
77
+ "url": "https://github.com/kozakdenys/qr-code-styling/issues"
78
+ },
79
+ "homepage": "https://qr-code-styling.com"
80
+ }