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

Improved LambdaHandler event typing #711

Merged
merged 1 commit into from
Mar 25, 2019
Merged

Improved LambdaHandler event typing #711

merged 1 commit into from
Mar 25, 2019

Conversation

rhys-jmc
Copy link
Contributor

@types/aws-lambda allows the event to be typed as shown here: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/aws-lambda/index.d.ts#L1028

Wrapping the handler with lambdaHandler() removed the @types/aws-lambda typing. Forcing the event to always be of type object breaks the expected type of event in the handler. This change would enable you to type lambdaHandler() similarly to Handler from @types/aws-lambda. It would reinstate the desired type of event for the handler.

It should also be considered to enable typing of the result and to use the Context type from @types/aws-lambda instead of object.

@waltjones
Copy link
Contributor

@VorkS Thanks your for the PR, and the detailed explanation.

@waltjones waltjones merged commit 8663694 into rollbar:master Mar 25, 2019
mudetroit pushed a commit that referenced this pull request Mar 14, 2024
Improved LambdaHandler event typing
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

Successfully merging this pull request may close these issues.

2 participants