/** * File Reader Factory * * Factory for creating configured SecureFileReader instances. * Provides sensible defaults and dependency injection support. * * @module FileReaderFactory * @version 3.2.0 */ import { RateLimiter } from "../services/security/rate-limiter.service.js"; import { SecureFileReader, IAuditLogger } from "./secure-file-reader.js"; /** * Options for creating a SecureFileReader */ export interface ReaderOptions { /** Maximum file size to read (default: 10MB) */ maxReadSize?: number; /** Rate limiter instance or configuration */ rateLimiter?: RateLimiter; maxRequestsPerMinute?: number; maxRequestsPerHour?: number; /** Custom audit logger (default: console logger) */ auditLogger?: IAuditLogger; /** Base path for path validation */ basePath?: string; /** Allowed paths for validation */ allowedPaths?: string[]; } /** * Factory for creating SecureFileReader instances * * @example * ```typescript * // Create with defaults * const reader = FileReaderFactory.createDefault(); * * // Create with custom options * const reader = FileReaderFactory.createWithOptions({ * maxReadSize: 5 * 1024 * 1024, // 5MB * maxRequestsPerMinute: 30, * basePath: '/allowed/directory' * }); * ``` */ export declare class FileReaderFactory { private static defaultAuditLogger; /** * Create a SecureFileReader with default configuration * * Default configuration: * - maxReadSize: 10MB * - maxRequestsPerMinute: 60 * - maxRequestsPerHour: 500 * - auditLogger: Console logger * - basePath: process.cwd() * * @returns Configured SecureFileReader instance */ static createDefault(): SecureFileReader; /** * Create a SecureFileReader with custom options * * @param options - Configuration options * @returns Configured SecureFileReader instance */ static createWithOptions(options: ReaderOptions): SecureFileReader; /** * Set the default audit logger for all future created readers * * @param auditLogger - The audit logger to use as default */ static setDefaultAuditLogger(auditLogger: IAuditLogger): void; } //# sourceMappingURL=factory.d.ts.map