mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-22 20:39:17 +08:00
Merge pull request #12695 from tdolsen/types-2.0
Add type definition for express-formidable
This commit is contained in:
16
express-formidable/express-formidable-tests.ts
Normal file
16
express-formidable/express-formidable-tests.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import express = require("express");
|
||||
import expform = require("express-formidable");
|
||||
|
||||
const app = express();
|
||||
|
||||
app.use("/form1", expform());
|
||||
app.use("/form2", expform({
|
||||
encoding: "utf-8",
|
||||
uploadDir: "./uploads",
|
||||
keepExtensions: true,
|
||||
type: "multipart",
|
||||
maxFieldsSize: 3 * 1024 * 1024,
|
||||
maxFields: 50,
|
||||
hash: "sha1",
|
||||
multiples: true
|
||||
}));
|
||||
21
express-formidable/index.d.ts
vendored
Normal file
21
express-formidable/index.d.ts
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
// Type definitions for express-formidable 1.0.0
|
||||
// Project: https://github.com/noraesae/express-formidable
|
||||
// Definitions by: Torkild Dyvik Olsen <https://github.com/tdolsen>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
import { RequestHandler } from "express";
|
||||
|
||||
interface ExpressFormidableOptions {
|
||||
encoding?: string;
|
||||
uploadDir?: string;
|
||||
keepExtensions?: boolean;
|
||||
type?: "multipart" | "urlencoded";
|
||||
maxFieldsSize?: number;
|
||||
maxFields?: number;
|
||||
hash?: boolean | "sha1" | "md5";
|
||||
multiples?: boolean;
|
||||
}
|
||||
|
||||
declare function ExpressFormidable(options?: ExpressFormidableOptions): RequestHandler;
|
||||
|
||||
export = ExpressFormidable;
|
||||
19
express-formidable/tsconfig.json
Normal file
19
express-formidable/tsconfig.json
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es6",
|
||||
"noImplicitAny": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"express-formidable-tests.ts"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user