@lglab/react-qr-code 1.1.0 → 1.2.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/dist/index.d.ts CHANGED
@@ -1,5 +1,9 @@
1
1
  import { JSX } from 'react/jsx-runtime';
2
- import { Ref } from 'react';
2
+
3
+ /**
4
+ * ReactQRCode props.
5
+ */
6
+ export declare type BackgroundSettings = string | GradientSettings;
3
7
 
4
8
  export declare type CrossOrigin = 'anonymous' | 'use-credentials' | '' | undefined;
5
9
 
@@ -9,9 +13,6 @@ export declare interface DataModulesSettings {
9
13
  randomSize?: boolean;
10
14
  }
11
15
 
12
- /**
13
- * ReactQRCode props.
14
- */
15
16
  export declare type DataModulesStyle = 'square' | 'square-sm' | 'rounded' | 'leaf' | 'vertical-line' | 'horizontal-line' | 'circle' | 'diamond' | 'star' | 'heart';
16
17
 
17
18
  export declare type DownloadFileFormat = 'svg' | 'png' | 'jpeg';
@@ -49,6 +50,19 @@ export declare interface FinderPatternOuterSettings {
49
50
 
50
51
  export declare type FinderPatternOuterStyle = 'square' | 'rounded-sm' | 'rounded' | 'rounded-lg' | 'circle' | 'inpoint-sm' | 'inpoint' | 'inpoint-lg' | 'outpoint-sm' | 'outpoint' | 'outpoint-lg' | 'leaf-sm' | 'leaf' | 'leaf-lg';
51
52
 
53
+ export declare interface GradientSettings {
54
+ type: GradientSettingsType;
55
+ stops: GradientSettingsStop[];
56
+ rotation?: number;
57
+ }
58
+
59
+ export declare interface GradientSettingsStop {
60
+ offset: string;
61
+ color: string;
62
+ }
63
+
64
+ export declare type GradientSettingsType = 'linear' | 'radial';
65
+
52
66
  /**
53
67
  * Image settings for the QR Code.
54
68
  */
@@ -210,7 +224,7 @@ export declare const ReactQRCode: {
210
224
  };
211
225
 
212
226
  export declare interface ReactQRCodeProps {
213
- ref?: Ref<ReactQRCodeRef>;
227
+ ref?: React.Ref<ReactQRCodeRef>;
214
228
  /**
215
229
  * The value to encode into the QR Code. An array of strings can be passed in
216
230
  * to represent multiple segments to further optimize the QR Code.
@@ -250,11 +264,14 @@ export declare interface ReactQRCodeProps {
250
264
  */
251
265
  boostLevel?: boolean;
252
266
  /**
253
- * The background color used to render the QR Code.
254
- * @see https://developer.mozilla.org/en-US/docs/Web/CSS/color_value
267
+ * The QR code background either a hex color or GradientSettings.
255
268
  * @defaultValue #FFFFFF
256
269
  */
257
- bgColor?: string;
270
+ background?: BackgroundSettings;
271
+ /**
272
+ * The gradient settings applied to the qr code data modules and finder patterns.
273
+ */
274
+ gradient?: GradientSettings;
258
275
  /**
259
276
  * The settings for the data modules.
260
277
  */