Open tangxinyao opened 7 years ago
l agree that. l also have to handle file uploading in koa2 with typescript. But l can't find type definition file for this module. Have you accomplished that ?
Hi, I just submitted type definitions to DefinitelyTyped. They can be found on npm at @types/koa-multer
. Note that to use the extra properties added to the ctx.req
object (e.g. files
) you have to do an explicit cast as follows (<multer.MulterIncomingMessage>ctx.req)
. The type cast is necessary since the type definitions for Koa do not allow for the ctx.req
property to be extended.
Nice @benstevens48
Some problems come to me when I try to use typescript to write my web app, so i wonder if you could write an index.d.ts file for this project to support vscode intellisense or make it easy for us to write code by typescript?