/******** Structured error handling with logging for silent failure operations */ export interface ErrorContext { operation: string; path?: string; slug?: string; details?: Record; } export type LogLevel = "debug" | "warn" | "error"; export interface ErrorHandlingOptions { /** Default value to return on error */ fallback: T; /** Log level for error messages */ logLevel?: LogLevel; /** Whether to include stack trace in logs */ includeStack?: boolean; } /** Execute async operation with error logging and fallback */ export declare function withErrorContext(operation: () => Promise, context: ErrorContext, options: ErrorHandlingOptions): Promise; /** Execute sync operation with error logging and fallback */ export declare function withErrorContextSync(operation: () => T, context: ErrorContext, options: ErrorHandlingOptions): T; /** Safe file stat with logging */ export declare function safeFileStat(adapter: { fs: { stat: (path: string) => Promise<{ isFile: boolean; isDirectory: boolean; }>; }; }, path: string, operation: string): Promise<{ isFile: boolean; isDirectory: boolean; } | null>; /** Safe file read with logging */ export declare function safeFileRead(adapter: { fs: { readFile: (path: string) => Promise; }; }, path: string, operation: string): Promise; /** Safe directory read with logging */ export declare function safeReadDir(adapter: { fs: { readDir: (path: string) => AsyncIterable; }; }, path: string, operation: string): Promise; /** Create a scoped error context helper for multiple related operations */ export declare function createErrorScope(operationPrefix: string): { run(operation: () => Promise, details: Omit, fallback: T, logLevel?: LogLevel): Promise; runSync(operation: () => T, details: Omit, fallback: T, logLevel?: LogLevel): T; }; //# sourceMappingURL=error-context.d.ts.map