Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
typings is the replacement for tsd:
https://github.com/typings/typings
My conclusion, having done this, is that typings is marginally less annoying than tsd. At least the config file no longer references Github commits.
Anyway, it's pretty much as before except I've opted for the "top-level"
.d.ts
rather than the individual.d.ts
' as we've done to date, e.g.:I did this because it saves several lines and because I see mentions on typings' website of the directory layout within
typings/
changing between releases.freedomjs was the only typing that presented a challenge: the type of
freedom
differs depending on whether your code runs inside or outside of a freedomjs module. Thefreedom-core-env
andfreedom-module-env
typings exist for this purpose (they're essentially one-liners and you should include one or the other, depending on the environment) - but if you want the convenience of using the top-level import then you're out of luck.My solution was to specify only
freedom
intypings.json
and have eachfreedom
-using source file specify the type offreedom
immediately after imports, e.g.:Horrible? Maybe...I'm loathe to lose the convenience of that top-level import just for freedomjs' weirdness, though.
egrep -ir 'declare (const|var) freedom' src/|wc -l
tells me that 47/117 source files needed thedeclare
- and I think that will fall, in time. Would appreciate your thoughts on this.This change is