/**
 * Type declarations for the 'clamscan' npm package.
 * The package does not ship its own types.
 */

declare module 'clamscan' {
    interface ClamScanOptions {
        removeInfected?: boolean;
        quarantineInfected?: boolean | string;
        scanLog?: string | null;
        debugMode?: boolean;
        fileList?: string | null;
        scanRecursively?: boolean;
        clamscan?: {
            path?: string;
            db?: string | null;
            scanArchives?: boolean;
            active?: boolean;
        };
        clamdscan?: {
            socket?: string | null;
            host?: string;
            port?: number;
            timeout?: number;
            localFallback?: boolean;
            path?: string;
            configFile?: string | null;
            multiscan?: boolean;
            reloadDb?: boolean;
            active?: boolean;
            bypassTest?: boolean;
        };
        preference?: 'clamdscan' | 'clamscan';
    }

    interface ScanResult {
        isInfected: boolean;
        file: string;
        viruses: string[];
    }

    class NodeClam {
        constructor();
        init(options?: ClamScanOptions): Promise<NodeClam>;
        isInfected(filePath: string): Promise<ScanResult>;
        scanDir(dirPath: string): Promise<{ goodFiles: string[]; badFiles: string[]; errors: Record<string, Error>; viruses: string[] }>;
        passthrough(): NodeJS.ReadWriteStream;
        getVersion(): Promise<string>;
    }

    export = NodeClam;
}
