/** * Receipt data structure returned by the OCR pipeline */ export interface ReceiptData { /** Receipt or invoice number */ receiptno: string; /** Name of the shop/store */ shopname: string; /** Date in ISO format (YYYY-MM-DD) */ date: string; /** Time in 24-hour format (HH:MM) */ time: string; /** Net amount (before tax) */ netAmount: number; /** Gross amount (total including tax) */ grossAmount: number; /** Total number of items purchased */ totalItems: number; } /** * Complete receipt scan response including structured data and raw OCR text */ export interface ReceiptScanResponse { /** Receipt or invoice number */ receiptno: string; /** Name of the shop/store */ shopname: string; /** Date in ISO format (YYYY-MM-DD) */ date: string; /** Time in 24-hour format (HH:MM) */ time: string; /** Net amount (before tax) */ netAmount: number; /** Gross amount (total including tax) */ grossAmount: number; /** Total number of items purchased */ totalItems: number; /** Raw OCR text input from the image */ rawInput: string; } /** * OCR configuration options */ export interface OCRConfig { /** Languages to use for OCR recognition */ languages: ('chi_sim' | 'chi_tra' | 'eng')[]; /** Level of image preprocessing (higher = more aggressive) */ preprocessingLevel: 'low' | 'medium' | 'high'; /** Minimum confidence threshold for OCR results (0-1) */ confidenceThreshold: number; /** Enable debug logging */ debug?: boolean; } /** * OCR result with confidence scores */ export interface OCRResult { /** Extracted text */ text: string; /** Confidence score (0-1) */ confidence: number; /** Detected language */ language: string; /** Processing time in milliseconds */ processingTime: number; } /** * Extracted field with confidence */ export interface ExtractedField { /** The extracted value */ value: T; /** Confidence score (0-1) */ confidence: number; /** Source text that was parsed */ source?: string; } /** * Partial receipt data with confidence scores */ export interface PartialReceiptData { receiptno?: ExtractedField; shopname?: ExtractedField; date?: ExtractedField; time?: ExtractedField; netAmount?: ExtractedField; grossAmount?: ExtractedField; totalItems?: ExtractedField; } /** * Image preprocessing options */ export interface PreprocessingOptions { /** Target DPI for OCR (default: 300) */ targetDPI?: number; /** Apply denoising */ denoise?: boolean; /** Apply sharpening */ sharpen?: boolean; /** Apply contrast enhancement */ enhanceContrast?: boolean; /** Apply perspective correction */ correctPerspective?: boolean; /** Convert to grayscale */ grayscale?: boolean; } /** * Pattern matching result */ export interface PatternMatch { /** Matched text */ match: string; /** Pattern that matched */ pattern: RegExp; /** Confidence score */ confidence: number; /** Position in text */ index: number; } //# sourceMappingURL=index.d.ts.map