export type ErrorContextValue = Record | string | null; export interface ErrorMeta { hint?: string; docs?: string; context?: ErrorContextValue; originalError?: Error | null; } export declare class JtcsvError extends Error { code: string; hint?: string; docs?: string; context?: ErrorContextValue; originalError?: Error | null; constructor(message: string, code?: string, meta?: ErrorMeta); } export declare class ValidationError extends JtcsvError { constructor(message: string, meta?: ErrorMeta); } export declare class SecurityError extends JtcsvError { constructor(message: string, meta?: ErrorMeta); } export declare class FileSystemError extends JtcsvError { originalError: Error | null; constructor(message: string, originalError?: Error | null, meta?: ErrorMeta); } export declare class ParsingError extends JtcsvError { lineNumber: number | null; column: number | null; context: ErrorContextValue; expected: string | null; actual: string | null; value: string | null; hint: string | undefined; originalMessage: string; constructor(message: string, lineNumber?: number | null, column?: number | null, context?: string | null, expected?: string | null, actual?: string | null, meta?: ErrorMeta & { value?: string | null; hint?: string; }); static csvFormat(message: string, lineNumber?: number | null, column?: number | null, rowContent?: string | null, hint?: string): ParsingError; static fieldCountMismatch(expectedCount: number, actualCount: number, lineNumber?: number | null, rowContent?: string | null): ParsingError; static unclosedQuotes(lineNumber?: number | null, column?: number | null, content?: string | null): ParsingError; static invalidDelimiter(delimiter: string, lineNumber?: number | null, context?: string | null): ParsingError; static cellValue(message: string, value: string, lineNumber?: number | null, column?: number | null, hint?: string): ParsingError; static fastPathBailout(reason: string, content?: string | null): ParsingError; } export declare class LimitError extends JtcsvError { limit: any; actual: any; constructor(message: string, limit: any, actual: any, meta?: ErrorMeta); } export declare class ConfigurationError extends JtcsvError { constructor(message: string, meta?: ErrorMeta); } export declare function createDetailedErrorMessage(baseMessage: string, details?: { lineNumber?: number; column?: number; context?: string; expected?: string; actual?: string; suggestion?: string; codeSnippet?: string; hint?: string; docs?: string; }): string; export declare class ErrorContext { private details; lineNumber(line: number): this; column(col: number): this; context(ctx: string): this; expected(exp: string): this; actual(act: string): this; suggestion(sugg: string): this; codeSnippet(snippet: string): this; hint(text: string): this; docs(link: string): this; buildMessage(baseMessage: string): string; throwParsingError(baseMessage: string): never; throwValidationError(baseMessage: string): never; } 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"; readonly STREAM_CREATION_ERROR: "STREAM_CREATION_ERROR"; readonly STREAM_PROCESSING_ERROR: "STREAM_PROCESSING_ERROR"; }; export type ErrorCode = typeof ERROR_CODES[keyof typeof ERROR_CODES]; export declare function createErrorMessage(type: ErrorCode, details: string): string; export declare function handleError(error: Error, context?: Record): never; export declare function safeExecuteAsync(fn: () => Promise, errorType: ErrorCode, context?: Record): Promise; export declare function safeExecuteSync(fn: () => T, errorType: ErrorCode, context?: Record): T; export declare function safeExecute(fn: () => T | Promise, errorType: ErrorCode, context?: Record): T | Promise; export type { JtcsvError as JtcsvErrorType, ValidationError as ValidationErrorType, SecurityError as SecurityErrorType, FileSystemError as FileSystemErrorType, ParsingError as ParsingErrorType, LimitError as LimitErrorType, ConfigurationError as ConfigurationErrorType };