@liquid-js/qr-code-styling 1.6.0-rc.4 → 1.6.0
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/lib/constants/errorCorrectionPercents.d.ts +6 -6
- package/lib/core/QRCodeStyling.d.ts +19 -19
- package/lib/core/QROptions.d.ts +31 -31
- package/lib/core/QRSVG.d.ts +38 -38
- package/lib/figures/cornerDot/QRCornerDot.d.ts +18 -18
- package/lib/figures/cornerSquare/QRCornerSquare.d.ts +20 -20
- package/lib/figures/dot/QRDot.d.ts +26 -26
- package/lib/index.d.ts +13 -13
- package/lib/node.d.ts +7 -7
- package/lib/qr-code-styling-node.js +1243 -1251
- package/lib/qr-code-styling-node.js.map +1 -1
- package/lib/qr-code-styling.js.map +1 -1
- package/lib/tools/browserImageTools.d.ts +9 -8
- package/lib/tools/browserUtils.d.ts +11 -11
- package/lib/tools/calculateImageSize.d.ts +15 -15
- package/lib/tools/getMode.d.ts +2 -2
- package/lib/tools/merge.d.ts +2 -2
- package/lib/tools/sanitizeOptions.d.ts +3 -3
- package/lib/types/index.d.ts +175 -175
- package/package.json +31 -31
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export declare const ErrorCorrectionPercents: {
|
|
2
|
-
L: number;
|
|
3
|
-
M: number;
|
|
4
|
-
Q: number;
|
|
5
|
-
H: number;
|
|
6
|
-
};
|
|
1
|
+
export declare const ErrorCorrectionPercents: {
|
|
2
|
+
L: number;
|
|
3
|
+
M: number;
|
|
4
|
+
Q: number;
|
|
5
|
+
H: number;
|
|
6
|
+
};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { ExtensionFunction, Options, QRCode } from "../types";
|
|
2
|
-
import { RequiredOptions } from "./QROptions";
|
|
3
|
-
export declare class QRCodeStyling {
|
|
4
|
-
_options: RequiredOptions;
|
|
5
|
-
_container?: HTMLElement;
|
|
6
|
-
_svg?: SVGElement;
|
|
7
|
-
_qr?: QRCode;
|
|
8
|
-
_extension?: ExtensionFunction;
|
|
9
|
-
_svgDrawingPromise?: Promise<void>;
|
|
10
|
-
constructor(options?: Partial<Options>);
|
|
11
|
-
static _clearContainer(container?: HTMLElement): void;
|
|
12
|
-
_setupSvg(): void;
|
|
13
|
-
_getElement(): Promise<SVGElement | undefined>;
|
|
14
|
-
update(options?: Partial<Options>): void;
|
|
15
|
-
append(container?: HTMLElement): void;
|
|
16
|
-
applyExtension(extension: ExtensionFunction): void;
|
|
17
|
-
deleteExtension(): void;
|
|
18
|
-
serialize(): Promise<string | undefined>;
|
|
19
|
-
}
|
|
1
|
+
import { ExtensionFunction, Options, QRCode } from "../types";
|
|
2
|
+
import { RequiredOptions } from "./QROptions";
|
|
3
|
+
export declare class QRCodeStyling {
|
|
4
|
+
_options: RequiredOptions;
|
|
5
|
+
_container?: HTMLElement;
|
|
6
|
+
_svg?: SVGElement;
|
|
7
|
+
_qr?: QRCode;
|
|
8
|
+
_extension?: ExtensionFunction;
|
|
9
|
+
_svgDrawingPromise?: Promise<void>;
|
|
10
|
+
constructor(options?: Partial<Options>);
|
|
11
|
+
static _clearContainer(container?: HTMLElement): void;
|
|
12
|
+
_setupSvg(): void;
|
|
13
|
+
_getElement(): Promise<SVGElement | undefined>;
|
|
14
|
+
update(options?: Partial<Options>): void;
|
|
15
|
+
append(container?: HTMLElement): void;
|
|
16
|
+
applyExtension(extension: ExtensionFunction): void;
|
|
17
|
+
deleteExtension(): void;
|
|
18
|
+
serialize(): Promise<string | undefined>;
|
|
19
|
+
}
|
package/lib/core/QROptions.d.ts
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { CanvasOptions, DotType, ErrorCorrectionLevel, Gradient, Mode, Options, ShapeType, TypeNumber } from "../types";
|
|
2
|
-
export interface RequiredOptions extends Options {
|
|
3
|
-
document: Document;
|
|
4
|
-
shape: ShapeType;
|
|
5
|
-
width: number;
|
|
6
|
-
height: number;
|
|
7
|
-
data: string;
|
|
8
|
-
qrOptions: {
|
|
9
|
-
typeNumber: TypeNumber;
|
|
10
|
-
mode?: Mode;
|
|
11
|
-
errorCorrectionLevel: ErrorCorrectionLevel;
|
|
12
|
-
};
|
|
13
|
-
imageOptions: {
|
|
14
|
-
hideBackgroundDots: boolean;
|
|
15
|
-
imageSize: number;
|
|
16
|
-
crossOrigin?: string;
|
|
17
|
-
margin: number;
|
|
18
|
-
};
|
|
19
|
-
dotsOptions: {
|
|
20
|
-
type: DotType;
|
|
21
|
-
color: string;
|
|
22
|
-
gradient?: Gradient;
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
export declare const defaultOptions: RequiredOptions;
|
|
26
|
-
export interface RequiredCanvasOptions extends CanvasOptions {
|
|
27
|
-
width: number;
|
|
28
|
-
height: number;
|
|
29
|
-
margin: number;
|
|
30
|
-
}
|
|
31
|
-
export declare const defaultCanvasOptions: RequiredCanvasOptions;
|
|
1
|
+
import { CanvasOptions, DotType, ErrorCorrectionLevel, Gradient, Mode, Options, ShapeType, TypeNumber } from "../types";
|
|
2
|
+
export interface RequiredOptions extends Options {
|
|
3
|
+
document: Document;
|
|
4
|
+
shape: ShapeType;
|
|
5
|
+
width: number;
|
|
6
|
+
height: number;
|
|
7
|
+
data: string;
|
|
8
|
+
qrOptions: {
|
|
9
|
+
typeNumber: TypeNumber;
|
|
10
|
+
mode?: Mode;
|
|
11
|
+
errorCorrectionLevel: ErrorCorrectionLevel;
|
|
12
|
+
};
|
|
13
|
+
imageOptions: {
|
|
14
|
+
hideBackgroundDots: boolean;
|
|
15
|
+
imageSize: number;
|
|
16
|
+
crossOrigin?: string;
|
|
17
|
+
margin: number;
|
|
18
|
+
};
|
|
19
|
+
dotsOptions: {
|
|
20
|
+
type: DotType;
|
|
21
|
+
color: string;
|
|
22
|
+
gradient?: Gradient;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export declare const defaultOptions: RequiredOptions;
|
|
26
|
+
export interface RequiredCanvasOptions extends CanvasOptions {
|
|
27
|
+
width: number;
|
|
28
|
+
height: number;
|
|
29
|
+
margin: number;
|
|
30
|
+
}
|
|
31
|
+
export declare const defaultCanvasOptions: RequiredCanvasOptions;
|
package/lib/core/QRSVG.d.ts
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
import { FilterFunction, Gradient, QRCode } from "../types";
|
|
2
|
-
import { RequiredOptions } from "./QROptions";
|
|
3
|
-
export declare class QRSVG {
|
|
4
|
-
_element: SVGElement;
|
|
5
|
-
_defs: SVGElement;
|
|
6
|
-
_backgroundClipPath?: SVGElement;
|
|
7
|
-
_dotsClipPath?: SVGElement;
|
|
8
|
-
_cornersSquareClipPath?: SVGElement;
|
|
9
|
-
_cornersDotClipPath?: SVGElement;
|
|
10
|
-
_options: RequiredOptions;
|
|
11
|
-
_qr?: QRCode;
|
|
12
|
-
_document: Document;
|
|
13
|
-
private _imageTools;
|
|
14
|
-
constructor(options: RequiredOptions);
|
|
15
|
-
get width(): number;
|
|
16
|
-
get height(): number;
|
|
17
|
-
getElement(): SVGElement;
|
|
18
|
-
drawQR(qr: QRCode): Promise<void>;
|
|
19
|
-
drawBackground(): void;
|
|
20
|
-
drawDots(filter?: FilterFunction): void;
|
|
21
|
-
drawCorners(): void;
|
|
22
|
-
drawImage({ width, height, count, dotSize }: {
|
|
23
|
-
width: number;
|
|
24
|
-
height: number;
|
|
25
|
-
count: number;
|
|
26
|
-
dotSize: number;
|
|
27
|
-
}): Promise<void>;
|
|
28
|
-
_createColor({ options, color, additionalRotation, x, y, height, width, name }: {
|
|
29
|
-
options?: Gradient;
|
|
30
|
-
color?: string;
|
|
31
|
-
additionalRotation: number;
|
|
32
|
-
x: number;
|
|
33
|
-
y: number;
|
|
34
|
-
height: number;
|
|
35
|
-
width: number;
|
|
36
|
-
name: string;
|
|
37
|
-
}): void;
|
|
38
|
-
}
|
|
1
|
+
import { FilterFunction, Gradient, QRCode } from "../types";
|
|
2
|
+
import { RequiredOptions } from "./QROptions";
|
|
3
|
+
export declare class QRSVG {
|
|
4
|
+
_element: SVGElement;
|
|
5
|
+
_defs: SVGElement;
|
|
6
|
+
_backgroundClipPath?: SVGElement;
|
|
7
|
+
_dotsClipPath?: SVGElement;
|
|
8
|
+
_cornersSquareClipPath?: SVGElement;
|
|
9
|
+
_cornersDotClipPath?: SVGElement;
|
|
10
|
+
_options: RequiredOptions;
|
|
11
|
+
_qr?: QRCode;
|
|
12
|
+
_document: Document;
|
|
13
|
+
private _imageTools;
|
|
14
|
+
constructor(options: RequiredOptions);
|
|
15
|
+
get width(): number;
|
|
16
|
+
get height(): number;
|
|
17
|
+
getElement(): SVGElement;
|
|
18
|
+
drawQR(qr: QRCode): Promise<void>;
|
|
19
|
+
drawBackground(): void;
|
|
20
|
+
drawDots(filter?: FilterFunction): void;
|
|
21
|
+
drawCorners(): void;
|
|
22
|
+
drawImage({ width, height, count, dotSize }: {
|
|
23
|
+
width: number;
|
|
24
|
+
height: number;
|
|
25
|
+
count: number;
|
|
26
|
+
dotSize: number;
|
|
27
|
+
}): Promise<void>;
|
|
28
|
+
_createColor({ options, color, additionalRotation, x, y, height, width, name }: {
|
|
29
|
+
options?: Gradient;
|
|
30
|
+
color?: string;
|
|
31
|
+
additionalRotation: number;
|
|
32
|
+
x: number;
|
|
33
|
+
y: number;
|
|
34
|
+
height: number;
|
|
35
|
+
width: number;
|
|
36
|
+
name: string;
|
|
37
|
+
}): void;
|
|
38
|
+
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { CornerDotType, RotateFigureArgs, BasicFigureDrawArgs, DrawArgs } from "../../types";
|
|
2
|
-
export declare class QRCornerDot {
|
|
3
|
-
_element?: SVGElement;
|
|
4
|
-
_svg: SVGElement;
|
|
5
|
-
_type: CornerDotType;
|
|
6
|
-
_document: Document;
|
|
7
|
-
constructor({ svg, type, document }: {
|
|
8
|
-
svg: SVGElement;
|
|
9
|
-
type: CornerDotType;
|
|
10
|
-
document: Document;
|
|
11
|
-
});
|
|
12
|
-
draw(x: number, y: number, size: number, rotation: number): void;
|
|
13
|
-
_rotateFigure({ x, y, size, rotation, draw }: RotateFigureArgs): void;
|
|
14
|
-
_basicDot(args: BasicFigureDrawArgs): void;
|
|
15
|
-
_basicSquare(args: BasicFigureDrawArgs): void;
|
|
16
|
-
_drawDot({ x, y, size, rotation }: DrawArgs): void;
|
|
17
|
-
_drawSquare({ x, y, size, rotation }: DrawArgs): void;
|
|
18
|
-
}
|
|
1
|
+
import { CornerDotType, RotateFigureArgs, BasicFigureDrawArgs, DrawArgs } from "../../types";
|
|
2
|
+
export declare class QRCornerDot {
|
|
3
|
+
_element?: SVGElement;
|
|
4
|
+
_svg: SVGElement;
|
|
5
|
+
_type: CornerDotType;
|
|
6
|
+
_document: Document;
|
|
7
|
+
constructor({ svg, type, document }: {
|
|
8
|
+
svg: SVGElement;
|
|
9
|
+
type: CornerDotType;
|
|
10
|
+
document: Document;
|
|
11
|
+
});
|
|
12
|
+
draw(x: number, y: number, size: number, rotation: number): void;
|
|
13
|
+
_rotateFigure({ x, y, size, rotation, draw }: RotateFigureArgs): void;
|
|
14
|
+
_basicDot(args: BasicFigureDrawArgs): void;
|
|
15
|
+
_basicSquare(args: BasicFigureDrawArgs): void;
|
|
16
|
+
_drawDot({ x, y, size, rotation }: DrawArgs): void;
|
|
17
|
+
_drawSquare({ x, y, size, rotation }: DrawArgs): void;
|
|
18
|
+
}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { CornerSquareType, DrawArgs, BasicFigureDrawArgs, RotateFigureArgs } from "../../types";
|
|
2
|
-
export declare class QRCornerSquare {
|
|
3
|
-
_element?: SVGElement;
|
|
4
|
-
_svg: SVGElement;
|
|
5
|
-
_type: CornerSquareType;
|
|
6
|
-
_document: Document;
|
|
7
|
-
constructor({ svg, type, document }: {
|
|
8
|
-
svg: SVGElement;
|
|
9
|
-
type: CornerSquareType;
|
|
10
|
-
document: Document;
|
|
11
|
-
});
|
|
12
|
-
draw(x: number, y: number, size: number, rotation: number): void;
|
|
13
|
-
_rotateFigure({ x, y, size, rotation, draw }: RotateFigureArgs): void;
|
|
14
|
-
_basicDot(args: BasicFigureDrawArgs): void;
|
|
15
|
-
_basicSquare(args: BasicFigureDrawArgs): void;
|
|
16
|
-
_basicExtraRounded(args: BasicFigureDrawArgs): void;
|
|
17
|
-
_drawDot({ x, y, size, rotation }: DrawArgs): void;
|
|
18
|
-
_drawSquare({ x, y, size, rotation }: DrawArgs): void;
|
|
19
|
-
_drawExtraRounded({ x, y, size, rotation }: DrawArgs): void;
|
|
20
|
-
}
|
|
1
|
+
import { CornerSquareType, DrawArgs, BasicFigureDrawArgs, RotateFigureArgs } from "../../types";
|
|
2
|
+
export declare class QRCornerSquare {
|
|
3
|
+
_element?: SVGElement;
|
|
4
|
+
_svg: SVGElement;
|
|
5
|
+
_type: CornerSquareType;
|
|
6
|
+
_document: Document;
|
|
7
|
+
constructor({ svg, type, document }: {
|
|
8
|
+
svg: SVGElement;
|
|
9
|
+
type: CornerSquareType;
|
|
10
|
+
document: Document;
|
|
11
|
+
});
|
|
12
|
+
draw(x: number, y: number, size: number, rotation: number): void;
|
|
13
|
+
_rotateFigure({ x, y, size, rotation, draw }: RotateFigureArgs): void;
|
|
14
|
+
_basicDot(args: BasicFigureDrawArgs): void;
|
|
15
|
+
_basicSquare(args: BasicFigureDrawArgs): void;
|
|
16
|
+
_basicExtraRounded(args: BasicFigureDrawArgs): void;
|
|
17
|
+
_drawDot({ x, y, size, rotation }: DrawArgs): void;
|
|
18
|
+
_drawSquare({ x, y, size, rotation }: DrawArgs): void;
|
|
19
|
+
_drawExtraRounded({ x, y, size, rotation }: DrawArgs): void;
|
|
20
|
+
}
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { DotType, GetNeighbor, DrawArgs, BasicFigureDrawArgs, RotateFigureArgs } from "../../types";
|
|
2
|
-
export declare class QRDot {
|
|
3
|
-
_element?: SVGElement;
|
|
4
|
-
_svg: SVGElement;
|
|
5
|
-
_type: DotType;
|
|
6
|
-
_document: Document;
|
|
7
|
-
constructor({ svg, type, document }: {
|
|
8
|
-
svg: SVGElement;
|
|
9
|
-
type: DotType;
|
|
10
|
-
document: Document;
|
|
11
|
-
});
|
|
12
|
-
draw(x: number, y: number, size: number, getNeighbor: GetNeighbor): void;
|
|
13
|
-
_rotateFigure({ x, y, size, rotation, draw }: RotateFigureArgs): void;
|
|
14
|
-
_basicDot(args: BasicFigureDrawArgs): void;
|
|
15
|
-
_basicSquare(args: BasicFigureDrawArgs): void;
|
|
16
|
-
_basicSideRounded(args: BasicFigureDrawArgs): void;
|
|
17
|
-
_basicCornerRounded(args: BasicFigureDrawArgs): void;
|
|
18
|
-
_basicCornerExtraRounded(args: BasicFigureDrawArgs): void;
|
|
19
|
-
_basicCornersRounded(args: BasicFigureDrawArgs): void;
|
|
20
|
-
_drawDot({ x, y, size }: DrawArgs): void;
|
|
21
|
-
_drawSquare({ x, y, size }: DrawArgs): void;
|
|
22
|
-
_drawRounded({ x, y, size, getNeighbor }: DrawArgs): void;
|
|
23
|
-
_drawExtraRounded({ x, y, size, getNeighbor }: DrawArgs): void;
|
|
24
|
-
_drawClassy({ x, y, size, getNeighbor }: DrawArgs): void;
|
|
25
|
-
_drawClassyRounded({ x, y, size, getNeighbor }: DrawArgs): void;
|
|
26
|
-
}
|
|
1
|
+
import { DotType, GetNeighbor, DrawArgs, BasicFigureDrawArgs, RotateFigureArgs } from "../../types";
|
|
2
|
+
export declare class QRDot {
|
|
3
|
+
_element?: SVGElement;
|
|
4
|
+
_svg: SVGElement;
|
|
5
|
+
_type: DotType;
|
|
6
|
+
_document: Document;
|
|
7
|
+
constructor({ svg, type, document }: {
|
|
8
|
+
svg: SVGElement;
|
|
9
|
+
type: DotType;
|
|
10
|
+
document: Document;
|
|
11
|
+
});
|
|
12
|
+
draw(x: number, y: number, size: number, getNeighbor: GetNeighbor): void;
|
|
13
|
+
_rotateFigure({ x, y, size, rotation, draw }: RotateFigureArgs): void;
|
|
14
|
+
_basicDot(args: BasicFigureDrawArgs): void;
|
|
15
|
+
_basicSquare(args: BasicFigureDrawArgs): void;
|
|
16
|
+
_basicSideRounded(args: BasicFigureDrawArgs): void;
|
|
17
|
+
_basicCornerRounded(args: BasicFigureDrawArgs): void;
|
|
18
|
+
_basicCornerExtraRounded(args: BasicFigureDrawArgs): void;
|
|
19
|
+
_basicCornersRounded(args: BasicFigureDrawArgs): void;
|
|
20
|
+
_drawDot({ x, y, size }: DrawArgs): void;
|
|
21
|
+
_drawSquare({ x, y, size }: DrawArgs): void;
|
|
22
|
+
_drawRounded({ x, y, size, getNeighbor }: DrawArgs): void;
|
|
23
|
+
_drawExtraRounded({ x, y, size, getNeighbor }: DrawArgs): void;
|
|
24
|
+
_drawClassy({ x, y, size, getNeighbor }: DrawArgs): void;
|
|
25
|
+
_drawClassyRounded({ x, y, size, getNeighbor }: DrawArgs): void;
|
|
26
|
+
}
|
package/lib/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { ErrorCorrectionPercents } from "./constants/errorCorrectionPercents";
|
|
2
|
-
import { QRCodeStyling } from "./core/QRCodeStyling";
|
|
3
|
-
import * as browserUtils from "./tools/browserUtils";
|
|
4
|
-
import * as types from "./types";
|
|
5
|
-
export * from "./tools/browserUtils";
|
|
6
|
-
export * from "./types";
|
|
7
|
-
export { ErrorCorrectionPercents, QRCodeStyling };
|
|
8
|
-
declare const _default: {
|
|
9
|
-
QRCodeStyling: typeof QRCodeStyling;
|
|
10
|
-
browserUtils: typeof browserUtils;
|
|
11
|
-
types: typeof types;
|
|
12
|
-
};
|
|
13
|
-
export default _default;
|
|
1
|
+
import { ErrorCorrectionPercents } from "./constants/errorCorrectionPercents";
|
|
2
|
+
import { QRCodeStyling } from "./core/QRCodeStyling";
|
|
3
|
+
import * as browserUtils from "./tools/browserUtils";
|
|
4
|
+
import * as types from "./types";
|
|
5
|
+
export * from "./tools/browserUtils";
|
|
6
|
+
export * from "./types";
|
|
7
|
+
export { ErrorCorrectionPercents, QRCodeStyling };
|
|
8
|
+
declare const _default: {
|
|
9
|
+
QRCodeStyling: typeof QRCodeStyling;
|
|
10
|
+
browserUtils: typeof browserUtils;
|
|
11
|
+
types: typeof types;
|
|
12
|
+
};
|
|
13
|
+
export default _default;
|
package/lib/node.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { RequiredOptions } from "./core/QROptions";
|
|
2
|
-
import { QRCodeStyling as _QRCodeStyling } from "./index";
|
|
3
|
-
export { ErrorCorrectionPercents } from "./constants/errorCorrectionPercents";
|
|
4
|
-
export * from "./types";
|
|
5
|
-
export declare class QRCodeStyling extends _QRCodeStyling {
|
|
6
|
-
constructor(options: RequiredOptions);
|
|
7
|
-
}
|
|
1
|
+
import { RequiredOptions } from "./core/QROptions";
|
|
2
|
+
import { QRCodeStyling as _QRCodeStyling } from "./index";
|
|
3
|
+
export { ErrorCorrectionPercents } from "./constants/errorCorrectionPercents";
|
|
4
|
+
export * from "./types";
|
|
5
|
+
export declare class QRCodeStyling extends _QRCodeStyling {
|
|
6
|
+
constructor(options: RequiredOptions);
|
|
7
|
+
}
|