/** * Configuration for ZATCA QR Generator * Users provide their certificate and signing details here */ export interface ZATCAConfig { /** * Your ZATCA-issued certificate (Base64 encoded or PEM format) * This will be used to extract the public key */ certificate?: string; /** * Your private key for signing invoices (Base64 encoded or PEM format) * Keep this secure and never commit to version control */ privateKey?: string; /** * Certificate signature from ZATCA certificate chain * Base64 encoded */ certificateSignature?: string; /** * Public key extracted from certificate * Base64 encoded - will be auto-extracted if certificate is provided */ publicKey?: string; } /** * Invoice data required for ZATCA QR Code generation * Simplified interface - only essential invoice details needed */ export interface InvoiceDetails { /** * Seller's legal name as registered with ZATCA * @example "My Company LLC" */ sellerName: string; /** * Seller's 15-digit VAT registration number * @example "300000000000003" */ vatNumber: string; /** * Invoice timestamp in ISO 8601 format * @example "2024-01-15T10:30:00Z" */ timestamp: string; /** * Total invoice amount including VAT (formatted as string with 2 decimals) * @example "1150.00" */ invoiceTotal: string; /** * Total VAT amount (formatted as string with 2 decimals) * @example "150.00" */ vatTotal: string; /** * Complete UBL XML invoice content * This will be hashed automatically */ invoiceXML: string; } /** * Complete invoice data with hash and signature * This is what gets encoded into the QR code */ export interface SignedInvoiceData { sellerName: string; vatNumber: string; timestamp: string; invoiceTotal: string; vatTotal: string; invoiceHash: string; digitalSignature: string; publicKey: string; certificateSignature: string; } /** * QR Code generation options */ export interface QRCodeOptions { /** * Error correction level * @default "M" */ errorCorrectionLevel?: 'L' | 'M' | 'Q' | 'H'; /** * QR code width in pixels * @default 300 */ width?: number; /** * Output type * @default "png" */ type?: 'image/png' | 'image/jpeg' | 'image/webp'; } /** * Validation error details */ export interface ValidationError { field: string; message: string; } /** * Result type for operations that can fail */ export type Result = { success: true; data: T; } | { success: false; error: E; }; //# sourceMappingURL=types.d.ts.map