-
Notifications
You must be signed in to change notification settings - Fork 125
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add TypeScript type definitions #66
Conversation
Finished adding as much as I could glean from the docs 馃憤 |
Hi @jeremydaly, PR is ready for review 馃槃 |
Awesome work, @hassankhan! I will give this a review in the next few days. Thanks for the PR! |
Hi @jeremydaly, any chance you could review the PR soon? 馃槃 |
I'm trying to get to it. It's been a busy week! |
Hi, so, this might be a newbie question, but how do you use this? Attempting to import any of these defined types throws an error, like so:
Am I doing something wrong? Or it seems like the definitions haven't been marked as exported? Looking at type definitions for similar projects, they all seem to mark their objects as exported - |
I added export to the classes + fixed the middleware signatures (use takes a callback for both errors and normal instances, not individual request/response/next instances). I put that version of it here: https://github.com/Wintereise/lambda-api/commit/6acd197540d940445eb02e5afcbafad41f80bcd9 Can you guys review? If all good, I'll open another pull request and add the new Error types in 0.9. |
Good catch @Wintereise, thanks for adding the exports. I've added a comment to your branch, aside from that all looks good to me 馃憤 |
Closes #28.
Since this project uses "Lambda" types for some things, for example
event
andcontext
, I added@types/aws-lambda
as adevDependency
. My reasoning being anyone using TypeScript with Lambda should/would already have that package installed. I suppose we could add it topeerDependencies
, but that would be annoying for non-TS users.I still have a bit of cleanup to do, any issues/feedback is most certainly welcome 馃憤