// Minimal type declaration for multer — replaced by @types/multer after npm install
declare module 'multer' {
  import { RequestHandler } from 'express';

  interface StorageEngine {}

  interface Options {
    storage?: StorageEngine;
    limits?: {
      fileSize?: number;
      files?: number;
      fields?: number;
    };
  }

  interface Multer {
    single(fieldname: string): RequestHandler;
    array(fieldname: string, maxCount?: number): RequestHandler;
    none(): RequestHandler;
  }

  interface MulterStatic {
    (options?: Options): Multer;
    memoryStorage(): StorageEngine;
    diskStorage(options: any): StorageEngine;
  }

  const multer: MulterStatic;
  export default multer;
}

declare namespace Express {
  namespace Multer {
    interface File {
      fieldname: string;
      originalname: string;
      encoding: string;
      mimetype: string;
      size: number;
      destination: string;
      filename: string;
      path: string;
      buffer: Buffer;
    }
  }

  interface Request {
    file?: Multer.File;
    files?: Multer.File[];
  }
}
