wreck icon indicating copy to clipboard operation
wreck copied to clipboard

How do I reference the return type of a Wreck request in typescript

Open cybercode opened this issue 8 months ago • 2 comments

Support plan

  • is this issue currently blocking your project? (yes/no):
  • is this issue affecting a production system? (yes/no):

Context

  • node version: 18
  • module version: 18.0.1
  • environment (e.g. node, browser, native): ts-node
  • used with (e.g. hapi application, another framework, standalone, ...): application
  • any other relevant information: n/a

How can we help?

I am trying to use Wreck in a typescript hapi service. I am unable figure out how to get the type definition for the Wreck.Response.

examples, none of the following work

async function fetch() : Promise<Wreck.Response> {}

causes the error "Cannot find namespace 'Wreck'"

and

import Wreck {Response} from '@hapi/wreck';

"Module '"@hapi/wreck"' has no exported member 'Response'."

cybercode avatar Oct 23 '23 12:10 cybercode