UNPKG

tsoa-zod-validator

Version:
37 lines (36 loc) 1.18 kB
import type { Request as ExpressRequest } from 'express'; /** * File object structure for uploaded files */ export interface UploadedFile { /** The field name specified in the form */ fieldname: string; /** The name of the file on the user's computer */ originalname: string; /** The encoding type of the file */ encoding: string; /** The MIME type of the file */ mimetype: string; /** The size of the file in bytes */ size: number; /** The folder to which the file has been saved (DiskStorage) */ destination?: string; /** The name of the file within the destination (DiskStorage) */ filename?: string; /** The full path to the uploaded file (DiskStorage) */ path?: string; /** A Buffer of the entire file (MemoryStorage) */ buffer?: Buffer; } /** * Extended Express Request with files property */ export interface RequestWithFiles extends ExpressRequest { /** * Object containing uploaded files. * Can be an array of files, a map of arrays of files, or null if no files were uploaded */ files?: UploadedFile[] | { [fieldname: string]: UploadedFile[]; } | null; }