Request: Provide typescript typings
P4sca1 opened this issue ยท 12 comments
Would be great if this API could provide TypeScript typings.
For maintainability and developer confidence, a rewrite in TypeScript might be a good choice.
Second that
@mpomarole is this going to be taken on? It would be extremely helpful.
I don't work on this package
I don't work on this package
Ha! Whoops. I misread something. I thought you were on the team.
Seems like there's a fair amount of demand for this. I'd be happy to help but I don't have time to do it all myself.
@baptistejamin @eliottvincent @valeriansaliou
Any chance we can at least get some acknowledgement on this issue? Is there any chance this might get picked up at some point?
We accept PRs on this, unfortunately no one at Crisp is doing any TypeScript, so I'm not sure what are the expectations or best practices on this.
But I can see there's tremendous demand. If anyone could provide a short sample of what's expected I can maybe try to replicate it for all methods.
Do you prefer a PR for a TypeScript rewrite (Pro: always correct types, best developer experience, Con: might be unfamiliar for maintainers who have never seen TS before) or should we just add types?
I'd go for a library in pure JS w/ TS types aside. That'd be the easiest to maintain for us. Because not all developers use TS.
I was able to generate TypeScript typings from the existing JSDoc: #36
https://www.typescriptlang.org/docs/handbook/declaration-files/dts-from-js.html
It's not perfect, but might be a good starting point.
All merged. Thanks a ton @P4sca1 !
The issue should not be closed. JSDoc generated types are far from perfect. The dynamically added services are not available directly, for example.