@vkontakte/vk-qr 2.1.1 → 3.1.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/src/types.ts CHANGED
@@ -3,59 +3,77 @@ export type QrOptions = {
3
3
  * Size of QR code
4
4
  * @default 128
5
5
  */
6
- qrSize?: number;
6
+ qrSize?: number | undefined;
7
7
 
8
8
  /**
9
9
  * Class name of root SVG element
10
10
  */
11
- className?: string;
11
+ className?: string | undefined;
12
12
 
13
13
  /**
14
14
  * Show VK logo in center of QR code
15
15
  * @default false
16
16
  */
17
- isShowLogo?: boolean;
17
+ isShowLogo?: boolean | undefined;
18
18
 
19
19
  /**
20
20
  * Show QR background
21
21
  * @default false
22
22
  */
23
- isShowBackground?: boolean;
23
+ isShowBackground?: boolean | undefined;
24
24
 
25
25
  /**
26
26
  * QR code background HEX color. Works if `isShowBackground` is enabled.
27
27
  * @default "#ffffff"
28
28
  */
29
- backgroundColor?: string;
29
+ backgroundColor?: string | undefined;
30
+
31
+ /**
32
+ * Background frame thickness in output pixels. Works if `isShowBackground` is enabled.
33
+ * Must be finite and non-negative. Clamped to half of `qrSize`.
34
+ * @default 20
35
+ */
36
+ backgroundPadding?: number | undefined;
37
+
38
+ /**
39
+ * Background corner radius in output pixels. Works if `isShowBackground` is enabled.
40
+ * Must be finite and non-negative. Clamped to half of `qrSize`.
41
+ * @default 36
42
+ */
43
+ backgroundRadius?: number | undefined;
30
44
 
31
45
  /**
32
46
  * QR code HEX color
33
47
  */
34
- foregroundColor?: string;
48
+ foregroundColor?: string | undefined;
35
49
 
36
50
  /**
37
51
  * Color of logo
38
52
  * @default "#000000"
39
53
  */
40
- logoColor?: string;
54
+ logoColor?: string | undefined;
41
55
 
42
56
  /**
43
57
  * Reference to logo as a reference IRI
44
58
  */
45
- logoData?: string | null;
59
+ logoData?: string | null | undefined;
46
60
 
47
61
  /**
48
62
  * SVG elements id postfix
49
63
  */
50
- suffix?: string;
64
+ suffix?: string | undefined;
51
65
 
52
66
  /**
53
67
  * ECC Level
54
68
  */
55
- ecc?: number
69
+ ecc?: number | undefined;
56
70
 
57
71
  /**
58
- * Custom INC_TILE_SIZE
72
+ * @deprecated Ignored. QR module size is fixed internally.
59
73
  */
60
- incTileSize?: number
74
+ incTileSize?: number | undefined;
61
75
  };
76
+
77
+ type NotUndefined<T> = { [k in keyof T]-?: Exclude<T[k], undefined> };
78
+
79
+ export type RequiredQrOptions = NotUndefined<QrOptions>;