UNPKG

emvco-qr-sdk

Version:

A robust TypeScript SDK for decoding, validating, and processing EMVCo-compliant QR codes used in digital payment systems.

18 lines (17 loc) 881 B
/** * Provides handler functions for different QR parsing modes. * Each handler converts TLV entities into a structure based on the selected strategy. */ import { TlvEntity } from '../../domain/entities/tlv.entity'; import { QRParseMode } from '../../domain/enums/qr-parse-mode.enum'; /** * Map of handlers used to convert parsed TLVs into objects based on the QR parsing mode. */ export declare const PARSE_MODE_HANDLERS: Record<QRParseMode, (tlvs: TlvEntity[]) => TlvEntity[] | Record<string, any>>; /** * Returns the appropriate handler for mapping TLVs using named fields, restricted to GLOBAL or CO. * * @param mode - The QR parse mode to use (must be GLOBAL or CO). * @returns A function that maps TLVs to named key/value objects. */ export declare const getNamedHandler: (mode: QRParseMode.GLOBAL | QRParseMode.CO) => ((tlvs: TlvEntity[]) => Record<string, any>);