Closed ghost closed 3 years ago
Thanks! You will have to explicitly type evt
and ctx
. TypeScript will then complain if the type doesn't match with what classValidator
returns.
The reason why then
is suggested is that this is an asynchronous function which needs to return a Promise.
Describe the bug
When
classValidator
is used incomposeHandler
, the types forevent
, andcontext
becomesany
. The return type is lost as well.To Reproduce
The following minimal code reproduces the error:
Expected behavior
A clear and concise description of what you expected to happen. Infer
event
,context
, andreturn
type.Additional context
Here is a screenshot from the code snippet, it weirdly expects a then: