upiqr 1.3.5 → 1.3.6
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 +6 -0
- package/dist/types/upiqr.d.ts +13 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
1
|
import QRCode from 'qrcode';
|
|
2
2
|
import { QRResult, UPIIntentParams } from './types/upiqr';
|
|
3
|
+
/**
|
|
4
|
+
* Generates a UPI QR code and intent URL.
|
|
5
|
+
* @param {UPIIntentParams} params - The UPI intent parameters.
|
|
6
|
+
* @param {QRCode.QRCodeToDataURLOptions} [qrOptions] - Optional QR code generation options.
|
|
7
|
+
* @returns {Promise<QRResult>} - A promise that resolves to the QR code and intent URL.
|
|
8
|
+
*/
|
|
3
9
|
export default function upiqr({ payeeVPA: pa, payeeName: pn, payeeMerchantCode: mc, transactionId: tid, transactionRef: tr, transactionNote: tn, amount: am, minimumAmount: mam, currency: cu, }: UPIIntentParams, qrOptions?: QRCode.QRCodeToDataURLOptions): Promise<QRResult>;
|
package/dist/types/upiqr.d.ts
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Supported image types for the QR code.
|
|
3
|
+
*/
|
|
1
4
|
export type ImageType = 'png' | 'jpeg' | 'webp';
|
|
5
|
+
/**
|
|
6
|
+
* Base64 encoded image string.
|
|
7
|
+
* @template imageType - The type of the image.
|
|
8
|
+
*/
|
|
2
9
|
export type Base64<imageType extends ImageType> = `data:image/${imageType};base64,${string}`;
|
|
10
|
+
/**
|
|
11
|
+
* Parameters for generating UPI intent.
|
|
12
|
+
*/
|
|
3
13
|
export interface UPIIntentParams {
|
|
4
14
|
payeeVPA: string;
|
|
5
15
|
payeeName: string;
|
|
@@ -12,6 +22,9 @@ export interface UPIIntentParams {
|
|
|
12
22
|
currency?: string;
|
|
13
23
|
transactionRefUrl?: string;
|
|
14
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* Result of the UPI QR code generation.
|
|
27
|
+
*/
|
|
15
28
|
export interface QRResult {
|
|
16
29
|
qr: Base64<ImageType>;
|
|
17
30
|
intent: string;
|
package/package.json
CHANGED