webtorrent / webtorrent

⚡️ Streaming torrent client for the web

Home Page:https://webtorrent.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

TechQuery opened this issue · comments

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.

commented

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