@types/express-formidable
TypeScript icon, indicating that this package has built-in type declarations

1.2.3 • Public • Published

Installation

npm install --save @types/express-formidable

Summary

This package contains type definitions for express-formidable (https://github.com/noraesae/express-formidable).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/express-formidable.

index.d.ts

import * as express from "express";
import { EventNames, Fields, Files } from "formidable";

// Extend the express request object with attached formidable files and fields
declare global {
    namespace Express {
        interface Request {
            fields?: Fields;
            files?: Files;
        }
    }
}

interface ExpressFormidableOptions {
    encoding?: string;
    uploadDir?: string;
    keepExtensions?: boolean;
    type?: "multipart" | "urlencoded";
    maxFileSize?: number;
    maxFieldsSize?: number;
    maxFields?: number;
    hash?: boolean | "sha1" | "md5";
    multiples?: boolean;
}

interface ExpressFormidableEvents {
    event: EventNames;
    action: (
        req: express.Request,
        res: express.Response,
        next: express.NextFunction,
        ...formidableParameters: any[]
    ) => void;
}

declare function ExpressFormidable(
    options?: ExpressFormidableOptions,
    events?: ExpressFormidableEvents[],
): express.RequestHandler;

declare namespace ExpressFormidable {}

export = ExpressFormidable;

Additional Details

Credits

These definitions were written by Torkild Dyvik Olsen, and Evan Shortiss.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/express-formidable

Weekly Downloads

5,058

Version

1.2.3

License

MIT

Unpacked Size

5.13 kB

Total Files

5

Last publish

Collaborators

  • types