hapijs / hapijs/wreck

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

Open
#303 2 comments 0 reactions 1 assignee Claimed by @Marsup View on GitHub
support
Dominant language
JavaScript
Stars
376
Forks
110
PR merge metrics
No merged PRs in 30d

Description

#### 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
```ts
async function fetch() : Promise {}
```
causes the error "Cannot find namespace 'Wreck'"

and
```ts
import Wreck {Response} from '@hapi/wreck';
```
"Module '"@hapi/wreck"' has no exported member 'Response'."

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.