import { BaseDecoder } from '../base/base.decoder.js'; import type { TInvoice, TCreditNote, TDebitNote } from '../../interfaces/common.js'; import { UBLDocumentType } from './ubl.types.js'; import { xpath } from '../../plugins.js'; /** * Base decoder for UBL-based invoice formats */ export declare abstract class UBLBaseDecoder extends BaseDecoder { protected doc: Document; protected namespaces: Record; protected select: xpath.XPathSelect; constructor(xml: string); /** * Decodes UBL XML into a TInvoice object * @returns Promise resolving to a TInvoice object */ decode(): Promise; /** * Gets the UBL document type * @returns UBL document type */ protected getDocumentType(): UBLDocumentType; /** * Decodes a UBL credit note * @returns Promise resolving to a TCreditNote object */ protected abstract decodeCreditNote(): Promise; /** * Decodes a UBL debit note (invoice) * @returns Promise resolving to a TDebitNote object */ protected abstract decodeDebitNote(): Promise; /** * Gets a text value from an XPath expression * @param xpath XPath expression * @param context Optional context node * @returns Text value or empty string if not found */ protected getText(xpathExpr: string, context?: Node): string; /** * Gets a number value from an XPath expression * @param xpath XPath expression * @param context Optional context node * @returns Number value or 0 if not found or not a number */ protected getNumber(xpathExpr: string, context?: Node): number; /** * Gets a date value from an XPath expression * @param xpath XPath expression * @param context Optional context node * @returns Date timestamp or current time if not found or invalid */ protected getDate(xpathExpr: string, context?: Node): number; /** * Checks if a node exists * @param xpath XPath expression * @param context Optional context node * @returns True if node exists */ protected exists(xpathExpr: string, context?: Node): boolean; }