mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
add @types/express-form-data (#37263)
* update types/body-scroll-lock * add types/vue-simplemde * fix * fix * express-form-data * update express-form-data * update by rules * update express-form-data-tests.ts
This commit is contained in:
parent
2247f5940e
commit
3ca8c5d6ac
27
types/express-form-data/express-form-data-tests.ts
Normal file
27
types/express-form-data/express-form-data-tests.ts
Normal file
@ -0,0 +1,27 @@
|
||||
import express = require('express');
|
||||
import os = require('os');
|
||||
import {
|
||||
parse,
|
||||
format,
|
||||
stream,
|
||||
union,
|
||||
} from 'express-form-data';
|
||||
|
||||
const app = express();
|
||||
|
||||
const options = {
|
||||
uploadDir: os.tmpdir(),
|
||||
autoClean: true,
|
||||
};
|
||||
|
||||
app.use(parse(options));
|
||||
app.use(format());
|
||||
app.use(stream());
|
||||
app.use(union());
|
||||
|
||||
app.all('/', (req, res, next) => {
|
||||
console.log(req.body);
|
||||
res.json(req.body);
|
||||
});
|
||||
|
||||
app.listen(8080);
|
||||
20
types/express-form-data/index.d.ts
vendored
Normal file
20
types/express-form-data/index.d.ts
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
// Type definitions for express-form-data 2.0
|
||||
// Project: https://github.com/ortexx/express-form-data#readme
|
||||
// Definitions by: nomnes <https://github.com/NomNes>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
import { NextHandleFunction } from 'connect';
|
||||
import { FormOptions } from 'multiparty';
|
||||
|
||||
export interface FormDataOptions extends FormOptions {
|
||||
autoClean?: boolean;
|
||||
}
|
||||
|
||||
export function parse(options?: FormDataOptions): NextHandleFunction;
|
||||
|
||||
export function format(): NextHandleFunction;
|
||||
|
||||
export function stream(): NextHandleFunction;
|
||||
|
||||
export function union(): NextHandleFunction;
|
||||
23
types/express-form-data/tsconfig.json
Normal file
23
types/express-form-data/tsconfig.json
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"express-form-data-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/express-form-data/tslint.json
Normal file
1
types/express-form-data/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user