Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

@cybercode

Description

@cybercode

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'."

Metadata

Metadata

Assignees

Labels

supportQuestions, discussions, and general support

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions