@liquid-js/qr-code-styling 1.6.0-rc.1 → 1.6.0-rc.4

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.
@@ -1,11 +1,11 @@
1
1
  import { QRCodeStyling } from "../core/QRCodeStyling";
2
- import { FileExtension } from "../types";
3
- export declare function drawToCanvas(qrCode: QRCodeStyling): {
2
+ import { CanvasOptions, FileExtension } from "../types";
3
+ export declare function drawToCanvas(qrCode: QRCodeStyling, options?: CanvasOptions): {
4
4
  canvas: HTMLCanvasElement;
5
5
  canvasDrawingPromise: Promise<void> | undefined;
6
6
  } | undefined;
7
7
  export declare function download(qrCode: QRCodeStyling, downloadOptions: FileExtension | {
8
8
  name?: string;
9
9
  extension: FileExtension;
10
- }): Promise<void>;
10
+ }, options?: CanvasOptions): Promise<void>;
11
11
  export declare function downloadURI(uri: string, name: string): void;
@@ -1,2 +1,3 @@
1
- import { RequiredOptions } from "../core/QROptions";
1
+ import { RequiredCanvasOptions, RequiredOptions } from "../core/QROptions";
2
2
  export declare function sanitizeOptions(options: RequiredOptions): RequiredOptions;
3
+ export declare function sanitizeCanvasOptions(options: RequiredCanvasOptions): RequiredCanvasOptions;
@@ -41,6 +41,7 @@ declare const TypeNumber: {
41
41
  0: 0;
42
42
  1: 1;
43
43
  2: 2;
44
+ 10: 10;
44
45
  3: 3;
45
46
  4: 4;
46
47
  5: 5;
@@ -48,7 +49,6 @@ declare const TypeNumber: {
48
49
  7: 7;
49
50
  8: 8;
50
51
  9: 9;
51
- 10: 10;
52
52
  11: 11;
53
53
  12: 12;
54
54
  13: 13;
@@ -104,7 +104,6 @@ export declare type Options = {
104
104
  shape?: ShapeType;
105
105
  width?: number;
106
106
  height?: number;
107
- margin?: number;
108
107
  data?: string;
109
108
  image?: string | Buffer | Blob;
110
109
  imageTools?: typeof browserImageTools;
@@ -140,6 +139,11 @@ export declare type Options = {
140
139
  gradient?: Gradient;
141
140
  } | false;
142
141
  };
142
+ export declare type CanvasOptions = {
143
+ width?: number;
144
+ height?: number;
145
+ margin?: number;
146
+ };
143
147
  export declare type FilterFunction = (i: number, j: number) => boolean;
144
148
  export declare type DrawArgs = {
145
149
  x: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@liquid-js/qr-code-styling",
3
- "version": "1.6.0-rc.1",
3
+ "version": "1.6.0-rc.4",
4
4
  "description": "Add a style and an image to your QR code",
5
5
  "main": "lib/qr-code-styling-node.js",
6
6
  "browser": "lib/qr-code-styling-node.js",
@@ -49,7 +49,8 @@
49
49
  "build:dev": "webpack --mode=development --config webpack.config.build.js",
50
50
  "test": "jest",
51
51
  "start": "webpack serve --open --config webpack.config.dev-server.js",
52
- "lint": "eslint . --fix"
52
+ "lint": "eslint . --fix",
53
+ "prepublishOnly": "npm run build"
53
54
  },
54
55
  "repository": {
55
56
  "type": "git",