mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-01 07:40:10 +00:00
Merge pull request #34415 from chrisgedrim/fix-connect-busboy
connect-busboy - Add busboy to Express.Request interface
This commit is contained in:
@@ -4,3 +4,10 @@ import * as express from 'express';
|
||||
|
||||
const options: connectBusboy.ConnectBusboyOptions = { immediate: true };
|
||||
const result: express.RequestHandler = connectBusboy(options);
|
||||
|
||||
const app = express();
|
||||
|
||||
app.use(connectBusboy());
|
||||
app.use((req: express.Request, res: express.Response, next: express.NextFunction) => {
|
||||
req.busboy.on('file', () => {});
|
||||
});
|
||||
|
||||
9
types/connect-busboy/index.d.ts
vendored
9
types/connect-busboy/index.d.ts
vendored
@@ -1,6 +1,7 @@
|
||||
// Type definitions for connect-busboy 0.0
|
||||
// Project: https://github.com/mscdex/connect-busboy
|
||||
// Definitions by: Pinguet62 <https://github.com/pinguet62>
|
||||
// Chris Gedrim <https://github.com/chrisgedrim>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
@@ -15,4 +16,12 @@ declare namespace connectBusboy {
|
||||
}
|
||||
}
|
||||
|
||||
declare global {
|
||||
namespace Express {
|
||||
interface Request {
|
||||
busboy: busboy.Busboy;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export = connectBusboy;
|
||||
|
||||
@@ -1 +1,3 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user