Hey, I'm new to typescript, but I'm pretty sure there's something going on with the types exported.
This expression is not callable.
Type 'NextConnect<NextApiRequest, NextApiResponse<any>>' has no call signatures.
ts(2349)
I wrap next-connect for use across a few related projects, and I want to add tests for the interface. So I'm manually calling the resulting api handler. A simplified case:
Hey, I'm new to typescript, but I'm pretty sure there's something going on with the types exported.
I wrap
next-connect
for use across a few related projects, and I want to add tests for the interface. So I'm manually calling the resulting api handler. A simplified case:I believe the fix in
index.d.ts
is on lines ~26-28. Move the function declaration inside the interface:That said, I'm not totally sure. Like I said, I'm still learning the ropes with TS.