mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-25 16:11:24 +08:00
Use Partial instead of defining new interface
This commit is contained in:
15
types/multer/index.d.ts
vendored
15
types/multer/index.d.ts
vendored
@@ -6,6 +6,7 @@
|
||||
// Michael Ledin <https://github.com/mxl>
|
||||
// HyunSeob Lee <https://github.com/hyunseob>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.1
|
||||
|
||||
import * as express from 'express';
|
||||
|
||||
@@ -48,22 +49,10 @@ declare namespace multer {
|
||||
}
|
||||
|
||||
interface StorageEngine {
|
||||
_handleFile(req: express.Request, file: Express.Multer.File, callback: (error?: any, info?: FileInfo) => void): void;
|
||||
_handleFile(req: express.Request, file: Express.Multer.File, callback: (error?: any, info?: Partial<Express.Multer.File>) => 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);
|
||||
|
||||
Reference in New Issue
Block a user