UNPKG

express-multipart

Version:

High performance lightweight Express middleware for handling multipart/form-data requests

24 lines (23 loc) 814 B
/// <reference types="node" /> import { NextFunction, Request, Response } from "express"; export declare type MultipartMiddleware = (req: Request, res: Response, next: NextFunction) => void; export declare type MultipartFile = { path: string; name: string; originalName: string; mime: string; extension: string; encoding: string; destination: string; }; export declare type MultipartOptions = { maxSize?: number; maxFieldSize?: number; maxFieldNameSize?: number; acceptedTypes?: string[]; destination?: string; preserveExtensions?: boolean; verifyMagic?: boolean; onInvalidMagic?: (file: NodeJS.ReadableStream, contentMime: string, binaryMime?: string) => boolean; fileName?: (originalName: string, mime: string) => string; };