Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upTypeScript support? #1230
TypeScript support? #1230
Comments
This comment has been minimized.
This comment has been minimized.
|
I don't believe there is any official task to add typescript definitions, but this would be a great opportunity to contribute w/ a PR :) As for the HTTP requests, webtorrent mainly operates over WebRTC data channels meaning it doesn't make any normal HTTP or websocket requests. This is due to our attempt to interop with the original bittorrent spec as closely as possible within the confines of the web. If you're interested in learning more about how webtorrent does its magic under the hood, I'd recommend watching one of Feross' excellent talks listed on the bottom of the main page. |
This comment has been minimized.
This comment has been minimized.
|
@IwHy4XnXCM I believe you can use this npm module: @types/webtorrent |
This comment has been minimized.
This comment has been minimized.
|
First question, no. But you can use what @alxhotel linked. Second: Yes, it's something I've been wanting to do since I did the http reimplementation. |
Apologies as this has probably been requested before.
Are there any plans for TypeScript support? I'd imagine a few people have gone and made their own fork, but I would like something official and up to date. Even just a declarations file (.d.ts) would be great, as I'm currently being forced to use the
anytype.Thanks.
EDIT (unrelated)
I have just noticed that WebTorrent makes constant HTTP requests in 128kb chunks to get the torrent data. Is it possible for this to be done over WebSocket? Not sure exactly how it works.