reykit 1.0.137 → 1.0.139
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.js +7 -8
- package/dist/src/image.d.ts +4 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -49436,19 +49436,18 @@ async function bI(a) {
|
|
|
49436
49436
|
const i = await cC.toDataURL(a), d = await (await fetch(i)).blob();
|
|
49437
49437
|
Yj(d);
|
|
49438
49438
|
}
|
|
49439
|
-
async function xI(a, i) {
|
|
49439
|
+
async function xI(a, i = "qrcode.png") {
|
|
49440
49440
|
const u = await cC.toDataURL(a), m = await (await fetch(u)).blob();
|
|
49441
49441
|
kj(m, i);
|
|
49442
49442
|
}
|
|
49443
|
-
async function SI(a, i) {
|
|
49443
|
+
async function SI(a, i, u, d = 4) {
|
|
49444
49444
|
if (typeof i == "string") {
|
|
49445
|
-
const
|
|
49446
|
-
if (!
|
|
49447
|
-
i =
|
|
49445
|
+
const g = document.getElementById(i);
|
|
49446
|
+
if (!g) throw new Error("element id not exists");
|
|
49447
|
+
i = g;
|
|
49448
49448
|
}
|
|
49449
|
-
|
|
49450
|
-
|
|
49451
|
-
i.setAttribute("src", u);
|
|
49449
|
+
const m = await cC.toDataURL(a, { width: u, margin: d });
|
|
49450
|
+
i.setAttribute("src", m);
|
|
49452
49451
|
}
|
|
49453
49452
|
const EI = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
49454
49453
|
__proto__: null,
|
package/dist/src/image.d.ts
CHANGED
|
@@ -16,11 +16,13 @@ export declare function openQrcode(text: string): Promise<void>;
|
|
|
16
16
|
* @param text - QRCode Text.
|
|
17
17
|
* @param fileName - File name.
|
|
18
18
|
*/
|
|
19
|
-
export declare function downloadQrcode(text: string, fileName
|
|
19
|
+
export declare function downloadQrcode(text: string, fileName?: string): Promise<void>;
|
|
20
20
|
/**
|
|
21
21
|
* Set qrcode URL to element `src` attribute.
|
|
22
22
|
*
|
|
23
23
|
* @param text - QRCode Text.
|
|
24
24
|
* @param element - Element instance or id.
|
|
25
|
+
* @param width - Width of Minimum pixel.
|
|
26
|
+
* @param margin - Number of margin blank square.
|
|
25
27
|
*/
|
|
26
|
-
export declare function setElementQrcode(text: string, element: HTMLElement | string): Promise<void>;
|
|
28
|
+
export declare function setElementQrcode(text: string, element: HTMLElement | string, width?: number, margin?: number): Promise<void>;
|