Open Rich-Harris opened 7 years ago
Sounds great! csv soundsystem project?
Is there a way to roll this into the generated documentation too? The last bit of work I have on the rollup/es6 branch is to fix the doc generator that was broken by breaking things out into multiple files.
my thoughts exactly! tbd whether i'll make it tonight. not sure what the docs story is. I feel like it ought to be possible to do at least what JSDocs can do from typings, but really not sure.
Something like this? http://typedoc.org/guides/installation/
oh, interesting. worth trying for sure
After looking into it, I'm not super impressed with typedoc. Let's stick with documentationjs for now since it's got all the examples and things. I got it mostly working today pending some minor investigation into a change.
On this topic, declarations have begun to be merged so we'll just keep on adding them to the rollup branch (more aptly named would be 3.0.0 branch) but, as you said, they don't need to be complete before this gets merged to master.
FYI what has been implemented so far is now available in 3.0.0.
FYI#2, after some investigation, this also works in Sublime Text with the Typscript plugin. You have to set the syntax to Typescript though, which is easier with the help of this project-specific syntax plugin.
I have become utterly spoiled by TypeScript, and desperately miss libraries that don't have type declarations.
Short demo of what using indian-ocean would be like with types (note: this is in a JavaScript file, not a TypeScript file, in VSCode):
On line 6, it knows that
readCsvSync
is one of the methods available, so we get fuzzy autocomplete. If we got the signature wrong (i.e. first argument isn't a string) it would tell us about it. On line 8, it knows thatcsv
is an array, so we get fuzzy autocomplete forforEach
. On line 9, it knows that the value ofraw.foo
is a string, so we get fuzzy autocomplete forstartsWith
.That was all made possible by adding a file called
node_modules/indian-ocean/index.d.ts
:We'd basically just need to add a bunch of those for all the different readers etc. It doesn't even need to be perfect first time, as TypeScript is fairly forgiving (it'll never prevent anything from running, just might give you some red squiggles).
Whaddaya think?