You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is this really a desired feature? I haven't ever wanted to use TypeScript personally since I love dynamically typed languages, and I have an affinity to stick with native JS. A while ago, someone submitted a PR that I rejected because I didn't want to maintain it for a small user-base. #24
Can you confirm this PR is what you want, and can you also show me that this adds value to people?
yes definition files for the package would be great. I am not sure about the content of the PR but the value of a type definition of your package. More and more developer in my team if more packages exists with the same idea select a package with type definition instead of a other.
It would support developers with typesafe development during transpiling but also in during development time because IDEs can check if the usage of the package is correct. And typesafe development become more and more popular in production development. Also plain nodeJS developers would get support from IDEs. As Javascript/Node developer using for example VSCode the IDE you also give you help for attributes and functions if the type definition is available.
added value to people:
support during development (type check)
support during development (in place documentation and help)
ensure production code use correct function syntax (transpiling check)
The type definition document is a formalized version of your text documentation.
I'm still not sure if it's worth adding Typescript to this project. If enough people subscribe to this issue or comment in it, I'll maintain some typescript definitions.
I'll leave the issue open as a result.
Reacted by Richard Littauer, Ash Kumar, Erki Esken, pj035, Matt R. Wilson, Vojtěch Štěpančík, Alex V. Povar, ian and Jordan Thomson
I just had a need for types for common-errors, resorted to defining our own override types for the API surface we needed right now (some Error types and helper/generateClass stuff). Followed these instructions for now but would be nice to have proper full typings from @types.
Also needed @types for common-errors, searched the main repo, found none, generated my own.
Here's my number one argument in favour of adding TS definitions to libraries: it adds literally no friction for users that don't use it, and significantly reduces friction for users that do. I can't count how many times I've installed a new library and been positively delighted when my IDE started to help me learn this new library automagically.
Producing them is trivial; even if you're not into the game of writing quality TS defs (which there is a lot to be said for), you can generate them – just like I did – as part of your build process using dts-gen without having to think about it. Your users won't get all the nice pop-up documentation that goes with well-written defs, but they'll at least be able to see what properties your objects have as they're typing.
This isn't just about static/dynamic typing – there's a lot more to gain here.
Activity
RichardLitt commentedon Aug 24, 2017
@dfenster What do you think about this?
dfenster commentedon Sep 10, 2017
Is this really a desired feature? I haven't ever wanted to use TypeScript personally since I love dynamically typed languages, and I have an affinity to stick with native JS. A while ago, someone submitted a PR that I rejected because I didn't want to maintain it for a small user-base. #24
Can you confirm this PR is what you want, and can you also show me that this adds value to people?
jimjaeger commentedon Sep 15, 2017
Hi David,
yes definition files for the package would be great. I am not sure about the content of the PR but the value of a type definition of your package. More and more developer in my team if more packages exists with the same idea select a package with type definition instead of a other.
It would support developers with typesafe development during transpiling but also in during development time because IDEs can check if the usage of the package is correct. And typesafe development become more and more popular in production development. Also plain nodeJS developers would get support from IDEs. As Javascript/Node developer using for example VSCode the IDE you also give you help for attributes and functions if the type definition is available.
added value to people:
The type definition document is a formalized version of your text documentation.
dfenster commentedon Nov 8, 2017
I'm still not sure if it's worth adding Typescript to this project. If enough people subscribe to this issue or comment in it, I'll maintain some typescript definitions.
I'll leave the issue open as a result.
erkiesken commentedon Jan 10, 2018
I just had a need for types for
common-errors, resorted to defining our own override types for the API surface we needed right now (some Error types and helper/generateClass stuff). Followed these instructions for now but would be nice to have proper full typings from @types.wosevision commentedon Feb 16, 2018
Also needed @types for
common-errors, searched the main repo, found none, generated my own.Here's my number one argument in favour of adding TS definitions to libraries: it adds literally no friction for users that don't use it, and significantly reduces friction for users that do. I can't count how many times I've installed a new library and been positively delighted when my IDE started to help me learn this new library automagically.
Producing them is trivial; even if you're not into the game of writing quality TS defs (which there is a lot to be said for), you can generate them – just like I did – as part of your build process using
dts-genwithout having to think about it. Your users won't get all the nice pop-up documentation that goes with well-written defs, but they'll at least be able to see what properties your objects have as they're typing.This isn't just about static/dynamic typing – there's a lot more to gain here.
abdulhannanali commentedon Jul 25, 2018
Yes TypeScript definitions are definitely useful. @dfenster You should really add them
darbio commentedon May 26, 2020
Use DefinitelyTyped:
https://www.npmjs.com/package/@types/common-errors