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
This might be impossible, but I'd be willing to explore it if anyone else is interested.
If a definition was statically analysable (no dynamic generation of types), it should technically be possible to spit out a typescript <filename>.tsd definition file that matches the runtime definitions.
You'd get compile time and run time checking in tandem for free, and editor support.
The .tsd files would automatically be detected by typescript tooling (editors/command line tools) whenever that module is required/imported.
The tool in question could bail out if the sanctuary definitions aren't statically analyzable, and suggest ways to make it analysable (using const for example).
As I said, this may be impossible, but I thought I'd at least suggest it. :)
The text was updated successfully, but these errors were encountered:
This might be impossible, but I'd be willing to explore it if anyone else is interested.
If a definition was statically analysable (no dynamic generation of types), it should technically be possible to spit out a typescript
<filename>.tsd
definition file that matches the runtime definitions.You'd get compile time and run time checking in tandem for free, and editor support.
The .tsd files would automatically be detected by typescript tooling (editors/command line tools) whenever that module is required/imported.
Something like:
Might generate:
And something like:
Might generate
The tool in question could bail out if the sanctuary definitions aren't statically analyzable, and suggest ways to make it analysable (using
const
for example).As I said, this may be impossible, but I thought I'd at least suggest it. :)
The text was updated successfully, but these errors were encountered: