Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please add .d.ts file to this project to support typescript #20

Open
tangxinyao opened this issue Nov 11, 2017 · 3 comments
Open

Please add .d.ts file to this project to support typescript #20

tangxinyao opened this issue Nov 11, 2017 · 3 comments

Comments

@tangxinyao
Copy link

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?

@Poseiden
Copy link

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 ?

@benstevens48
Copy link

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.

@kiramishima
Copy link

Nice @benstevens48 <Multer.MulterIncomingMessage> cast, solves ctx.req.file or files :)
Merci Beaucoup

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants