I am looking for a WebSockets library written in TypeScript
https://www.quora.com/unanswered/Is-there-a-Websocket-library-for-Node-js-written-in-TypeScript
it looks like @types/ws exists, but since it's packaged separately, often the types become out-of-sync.
case in point, latest version of the types is: @types/[email protected], latest version of the lib is 7.x.
@lpinca that twitter thread is about writing @types/ws which already exists. I am talking about writing the library itself in TS.
I looked at the codebase. All you have to do is transpile src to lib:
src -> lib
using TS, it's easy to do
I don't want to rewrite the lib in TypeScript, maintain type definitions, and add any additional transpile step, sorry.
I respect the choice of not adding work to re-implement the library in typescript. But just wanted to correct that if the all the code is re-written in typescript, then there is no need to maintain type definitions separately.
its possible that TS can target WebAssembly, so it might be a good idea :-)
I respect the choice of not adding work to re-implement the library in typescript. But just wanted to correct that if the all the code is re-written in typescript, then there is no need to maintain type definitions separately.
Yes, type definitions will be generated automatically at compile time. Just write ts and run tsc is enough. This library does not depend on other libraries, it should not be difficult to write using TypeScript, maybe I can have a try if I'm free.
Most helpful comment
Yes, type definitions will be generated automatically at compile time. Just write ts and run
tscis enough. This library does not depend on other libraries, it should not be difficult to write using TypeScript, maybe I can have a try if I'm free.