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

fix(core) #1239 #1257

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

fix(core) #1239 #1257

wants to merge 1 commit into from

Conversation

R11baka
Copy link

@R11baka R11baka commented Nov 13, 2024

fix #1239
TLDR added type for handler method

@willfarrell
Copy link
Member

willfarrell commented Nov 13, 2024

Thanks for the PR. Would you be able to update the TS tests so that they pass? Once passing I can merge this into the v6 branch which is set to release later this month.

packages/core/index.test-d.ts:411:0
  ✖  411:0   Parameter type MiddyfiedHandler<S3Event, any, Error, Context, {}> is not identical to argument type MiddyfiedHandler<S3Event, void, Error, Context, {}>.                                                                                                                                                                                                                                                                                                                    
  ✖  415:18  Parameter event implicitly has an any type.                                                                                                                                                                                                                                                                                                                                                                                                                                 
  ✖  4[18](https://github.com/middyjs/middy/actions/runs/11817380388/job/32924868218?pr=1257#step:5:19):0   Parameter type MiddyfiedHandler<APIGatewayProxyEvent, number, Error, Context, {}> is not identical to argument type MiddyfiedHandler<any, number, Error, Context, {}>.                                                                                                                                                                                                                                                                                                      
  ✖  422:2   Unused @ts-expect-error directive.                                                                                                                                                                                                                                                                                                                                                                                                                                          
  ✖  426:65  Argument of type MiddyfiedHandler<APIGatewayProxyEvent, string, Error, Context, {}> is not assignable to parameter of type MiddyfiedHandler<APIGatewayProxyEvent, number, Error, Context, {}>.
  Types of property before are incompatible.
    Type AttachMiddlewareFn<APIGatewayProxyEvent, string, Error, Context, {}> is not assignable to type AttachMiddlewareFn<APIGatewayProxyEvent, number, Error, Context, {}>.
      Type string is not assignable to type number.  

  5 errors

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