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

wrong Return Value type of client.get() in @types/webtorrent packages #2782

Closed
TechQuery opened this issue Apr 29, 2024 · 1 comment · May be fixed by #2787
Closed

wrong Return Value type of client.get() in @types/webtorrent packages #2782

TechQuery opened this issue Apr 29, 2024 · 1 comment · May be fixed by #2787

Comments

@TechQuery
Copy link

What version of this package are you using?

@types/webtorrent@0.109.8

What operating system, Node.js, and npm version?

  • OS: Windows 10 Pro 22H2
  • Node.js: 18.x
  • PNPM: 9.x

What happened?

Latest WebTorrent has an async client.get() method:

webtorrent/docs/api.md

Lines 231 to 233 in 41cb62b

## `await client.get(torrentId)`
Returns a promise which resolves the torrent with the given `torrentId`. Convenience method. Easier than searching

but its Type Defination package has no Promise type on the return value of client.get():

https://github.com/DefinitelyTyped/DefinitelyTyped/blob/0474990ae3c1b3745cc7bd6dd83f69c2f574f4de/types/webtorrent/index.d.ts#L136

What did you expect to happen?

The Type Defination package has the same type of the Implement package.

Are you willing to submit a pull request to fix this bug?

I may submit a PR after this bug being confirmed by @webtorrent team.

@ThaUnknown
Copy link
Member

yes, this is a bug in the @types/webtorrent package, which isn't maintained by webtorrent, we have no control over it

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

Successfully merging a pull request may close this issue.

2 participants