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

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

Open
cybercode opened this issue Oct 23, 2023 · 2 comments
Open
Assignees
Labels
support Questions, discussions, and general support

Comments

@cybercode
Copy link

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 cybercode added the support Questions, discussions, and general support label Oct 23, 2023
@Marsup Marsup transferred this issue from hapijs/hapi Oct 23, 2023
@Marsup
Copy link
Contributor

Marsup commented Oct 23, 2023

I don't think it's exposed right now, is inference a problem?

@Marsup
Copy link
Contributor

Marsup commented Oct 23, 2023

@Marsup Marsup self-assigned this Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support Questions, discussions, and general support
Projects
None yet
Development

No branches or pull requests

2 participants