Closed ajschmidt8 closed 1 year ago
On second thought, I pushed a commit to re-add the context
argument with associated types. This will be helpful in case the argument is ever used in the future.
It's not showing up on this PR yet. I am going to close and re-open this PR to see if I can get it to refresh. I assume it's an issue on GitHub's end.
It's not showing up on this PR yet. I am going to close and re-open this PR to see if I can get it to refresh. I assume it's an issue on GitHub's end.
that worked :slightly_smiling_face:
@gr2m, can you take a look at this when you have a minute?
I updated the CI so that tests should run on PRs as well now 👍🏼
If you want, it would be great to add type tests using https://github.com/SamVerschueren/tsd to avoid future regressions. Up to you! This is good to merge as is
Oh, that's interesting. I'll take a look at that sometime.
thanks for merging!
GitHubCheck TypeScript type definitions. Contribute to SamVerschueren/tsd development by creating an account on GitHub.
:tada: This PR is included in version 3.0.3 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
This PR fixes the types in
index.d.ts
.Currently, the type signature for
createLambdaFunction
returns a type ofAPIGatewayProxyHandler
which doesn't match its implementation.See the source code for
APIGatewayProxyHandler
here:APIGatewayProxyHandler
(which ultimately usesHandler
, below) - https://github.com/DefinitelyTyped/DefinitelyTyped/blob/b384d9e82713dc8400a1289eeb9be7f2fc467390/types/aws-lambda/trigger/api-gateway-proxy.d.ts#L12Handler
- https://github.com/DefinitelyTyped/DefinitelyTyped/blob/b384d9e82713dc8400a1289eeb9be7f2fc467390/types/aws-lambda/handler.d.ts#L83-L88void | Promise<APIGatewayProxyResult>
. both of these items don't matchlambda-function.js
, which only requires two arguments and returns a type ofPromise<APIGatewayProxyResult>
Instead of using
APIGatewayProxyHandler
, I switched the return type to simply be a function which accepts a singleAPIGatewayProxyEvent
argument and returns aPromise<APIGatewayProxyResult>
type.This change also means the unused
context
argument increateLambdaFunction
can be removed.