import { ValidationConfig } from '../interfaces/upload-options.interface'; import { MagicDetector } from './magic-bytes'; export interface ValidationResult { /** Final content type (detected content wins over the client hint). */ mime: string; size: number; } /** * Validates a buffered file by size + real content type. The client MIME/extension is a * hint only; magic bytes are authoritative. Undetectable binary content is rejected. */ export declare class FileValidatorService { private readonly maxSize?; private readonly allow; private readonly magicBytes; private readonly signatureless; private readonly detector; constructor(config?: ValidationConfig, detector?: MagicDetector); /** Validate a full in-memory buffer (server-side upload path). */ validate(input: { buffer: Buffer; size?: number; mimeType: string; originalName?: string; }): ValidationResult; /** * Validate from a header slice + known size — used to sniff a presigned upload at confirm * without downloading the whole object. */ validateHeader(header: Buffer, meta: { size: number; mimeType: string; }): ValidationResult; }