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

Type information for client constructor incorrect #337

Open
dominykas opened this issue Dec 11, 2024 · 1 comment
Open

Type information for client constructor incorrect #337

dominykas opened this issue Dec 11, 2024 · 1 comment
Labels
bug Bug or defect

Comments

@dominykas
Copy link
Contributor

Runtime

node.js

Runtime version

v20/v22

Module version

v14

Last module version without issue

No response

Used with

No response

Any other relevant information

https://github.com/hapijs/nes/blob/master/lib/client.d.ts#L176 - options.ws for the constructor are declared as a string, but ws package actually accepts an object.

Might open a PR myself later.

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

new Client(url, { ws: { origin } })

What was the result you got?

Argument type {ws: {origin: string}} is not assignable to parameter type {ws?: string | string[], timeout?: number | boolean} | undefined

What result did you expect?

Things to actually work (since there's no actual change in the code since v13 anyways).

@dominykas dominykas added the bug Bug or defect label Dec 11, 2024
@damusix
Copy link
Contributor

damusix commented Dec 11, 2024

Hey thanks for pointing this out. These types were ported from DTS and not everything might have been caught. If you find more, report it. I'll fix it ASAP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug or defect
Projects
None yet
Development

No branches or pull requests

2 participants