Open pauldraper opened 8 months ago
This might be worth a fork
I'd always be in favor of making these types easier for end users to adopt in their projects.
If either of you ( @btonasse, @pauldraper) have explored this in a fork, feel free to suggest a PR?
Have we previously considered adding this to DefinitelyTyped? If so, why isn't this there? If not, it's worth looking into.
Sounds interesting, I don't know if it was ever considered, we'd have to ask @johnogle222
I am far from qualified to comment on the best way to declare typescript definitions these days. There's no particular reason why this project is setup using the conventions that it is other than it worked for me at the time and others grew it from there. If there is a better way to structure it that makes the project easier to adopt and use then by all means don't let me get in the way :)
Hi @ShawnTalbert I'm also far from a typescript expert, so I don't know if anything I did there is good practice, but I actually did create a fork: https://github.com/btonasse/suitescript-types
Re "best practice": The most user-friendly thing to do is to get types in https://github.com/DefinitelyTyped/DefinitelyTyped, as @types/suitescript
.
Similar to @types/node
https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node .
Path mappings work, but are rarely used since every downstream TypeScript project also has to set them.
More typical is module declarations.
These are then added by one of:
@types
as a npm alias (or having the project in DefinitelyTyped to begin with)typeRoots
./// <reference types="..." />
Note that module declarations is how Node.js typings work (
@types/node
).