import type { CalculationConfig, MatchFieldPair, OutputFieldConfig } from '../interfaces'; export interface ErrorConfig { calculationConfig?: CalculationConfig; matchFields?: MatchFieldPair[]; outputConfig?: OutputFieldConfig; [key: string]: unknown; } export declare enum ErrorCategory { INPUT_ERROR = "INPUT_ERROR", PROCESSING_ERROR = "PROCESSING_ERROR", DATA_ERROR = "DATA_ERROR", SYSTEM_ERROR = "SYSTEM_ERROR" } export declare enum ErrorCode { INVALID_FIELD_NAME = "INVALID_FIELD_NAME", PARSING_ERROR = "PARSING_ERROR", VALIDATION_ERROR = "VALIDATION_ERROR", EMPTY_DATASET = "EMPTY_DATASET", MISSING_REQUIRED_FIELD = "MISSING_REQUIRED_FIELD", UNKNOWN_ERROR = "UNKNOWN_ERROR", INVALID_PRICE_LIST_FORMAT = "INVALID_PRICE_LIST_FORMAT", INVALID_USAGE_DATA_FORMAT = "INVALID_USAGE_DATA_FORMAT", MISSING_MATCH_FIELDS = "MISSING_MATCH_FIELDS", MULTIPLE_MATCHES_FOUND = "MULTIPLE_MATCHES_FOUND", NO_MATCH_FOUND = "NO_MATCH_FOUND", MULTIPLE_CUSTOMER_MATCHES_FOUND = "MULTIPLE_CUSTOMER_MATCHES_FOUND" } export interface StandardizedError { code: ErrorCode; message: string; category: ErrorCategory; context?: Record; suggestions?: string[]; timestamp: string; debug?: { errorType: string; trace?: string; }; } /** * Creates a standardized error object */ export declare function createStandardizedError(code: ErrorCode, message: string, category: ErrorCategory, options?: { context?: Record; suggestions?: string[]; error?: Error; includeDebug?: boolean; }): StandardizedError; /** * Detects error type and creates appropriate standardized error */ export declare function handleError(error: Error, config?: ErrorConfig): StandardizedError; /** * Creates a standardized validation error for invalid price list items */ export declare function createValidationError(itemErrors: Array<{ record: Record; errors: string[]; }>): StandardizedError; /** * Validates price list data structure for matchUsageAndCalculate operation */ export declare function validatePriceListStructure(priceList: unknown): { valid: boolean; error?: StandardizedError; }; /** * Validates usage data structure for matchUsageAndCalculate operation */ export declare function validateUsageDataStructure(usageData: unknown): { valid: boolean; error?: StandardizedError; }; /** * Validates match fields configuration for matchUsageAndCalculate operation */ export declare function validateMatchFields(matchFields: MatchFieldPair[]): { valid: boolean; error?: StandardizedError; }; /** * Creates a standardized error for unmatched records */ export declare function createUnmatchedRecordsError(unmatchedRecords: unknown[], matchReason: 'none' | 'multiple'): StandardizedError;