export interface ErrorDetails { [key: string]: any; originalError?: Error; lineNumber?: number; limit?: any; actual?: any; hint?: string; docs?: string; context?: any; } export declare class JTCSVError extends Error { code: string; details: ErrorDetails; hint?: string; docs?: string; context?: any; constructor(message: string, code?: string, details?: ErrorDetails); } export declare class ValidationError extends JTCSVError { constructor(message: string, details?: ErrorDetails); } export declare class SecurityError extends JTCSVError { constructor(message: string, details?: ErrorDetails); } export declare class FileSystemError extends JTCSVError { constructor(message: string, originalError?: Error, details?: ErrorDetails); } export declare class ParsingError extends JTCSVError { lineNumber?: number; constructor(message: string, lineNumber?: number, details?: ErrorDetails); } export declare class LimitError extends JTCSVError { limit: any; actual: any; constructor(message: string, limit: any, actual: any, details?: ErrorDetails); } export declare class ConfigurationError extends JTCSVError { constructor(message: string, details?: ErrorDetails); } export declare const ERROR_CODES: { readonly JTCSV_ERROR: "JTCSV_ERROR"; readonly VALIDATION_ERROR: "VALIDATION_ERROR"; readonly SECURITY_ERROR: "SECURITY_ERROR"; readonly FILE_SYSTEM_ERROR: "FILE_SYSTEM_ERROR"; readonly PARSING_ERROR: "PARSING_ERROR"; readonly LIMIT_ERROR: "LIMIT_ERROR"; readonly CONFIGURATION_ERROR: "CONFIGURATION_ERROR"; readonly INVALID_INPUT: "INVALID_INPUT"; readonly SECURITY_VIOLATION: "SECURITY_VIOLATION"; readonly FILE_NOT_FOUND: "FILE_NOT_FOUND"; readonly PARSE_FAILED: "PARSE_FAILED"; readonly SIZE_LIMIT: "SIZE_LIMIT"; readonly INVALID_CONFIG: "INVALID_CONFIG"; readonly UNKNOWN_ERROR: "UNKNOWN_ERROR"; }; export type ErrorCode = typeof ERROR_CODES[keyof typeof ERROR_CODES]; export declare function safeExecute(fn: () => T, errorCode?: ErrorCode, errorDetails?: ErrorDetails): T; export declare function safeExecuteAsync(fn: () => Promise | T, errorCode?: ErrorCode, errorDetails?: ErrorDetails): Promise; export declare function createErrorMessage(error: Error | JTCSVError, includeStack?: boolean): string; export declare function handleError(error: Error | JTCSVError, options?: { log?: boolean; throw?: boolean; format?: boolean; }): string;