diff --git a/types/multer/index.d.ts b/types/multer/index.d.ts index f056323625..8686cc062a 100644 --- a/types/multer/index.d.ts +++ b/types/multer/index.d.ts @@ -4,6 +4,7 @@ // vilicvane // David Broder-Rodgers // Michael Ledin +// HyunSeob Lee // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped import * as express from 'express'; @@ -47,10 +48,22 @@ declare namespace multer { } interface StorageEngine { - _handleFile(req: express.Request, file: Express.Multer.File, callback: (error?: any, info?: Express.Multer.File) => void): void; + _handleFile(req: express.Request, file: Express.Multer.File, callback: (error?: any, info?: FileInfo) => void): void; _removeFile(req: express.Request, file: Express.Multer.File, callback: (error: Error) => void): void; } + interface FileInfo { + fieldname?: string; + originalname?: string; + encoding?: string; + mimetype?: string; + size?: number; + destination?: string; + filename?: string; + path?: string; + buffer?: Buffer; + } + interface DiskStorageOptions { /** A function used to determine within which folder the uploaded files should be stored. Defaults to the system's default temporary directory. */ destination?: string | ((req: Express.Request, file: Express.Multer.File, callback: (error: Error | null, destination: string) => void) => void);