hapijs / hapi

The Simple, Secure Framework Developers Trust

Home Page:https://hapi.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

I cannot get any types

johnnyshankman opened this issue · comments

Runtime

node

Runtime version

v20

Module version

"^20.1.4",

Last module version without issue

No response

Used with

No response

Any other relevant information

No response

What are you trying to achieve or the steps to reproduce?

import { Request, ResponseToolkit } from '@hapi/hapi';

lets me import but ResponseToolkit is just any.

What was the result you got?

any
Screenshot 2024-06-04 at 6 30 26 PM

What result did you expect?

a real type

Looking at the source code in v20 (like v20.3.0), hapi didn't ship with its own types. The types were added from DT only at v21.1.0: https://github.com/hapijs/hapi/blob/v21.1.0/lib/index.d.ts. Your solution is either:

  1. Upgrade to latest version of hapi.
  2. Install @types/hapi__hapi to use the DT types.

I'll close this for now since I don't consider this a bug in hapi. We can always reopen if it was a mistake.