Add type declarations
See original GitHub issue@andrewiggins I figured I’d create a separate issue for this one, since your work is already enough to get projects up and going without it.
It would be great if we could also get some type-checking for elements and attributes - standard DOM as well as pico’s oncreate
etc., and possibly SVG elements. (does pico support SVG?)
I tried something like [elemName in keyof ElementTagNameMap]?: any;
in the IntrinsicElements
declaration - I think I’ve seen others doing something similar, but I couldn’t make it work.
Snabbdom redeclares the whole kit’n’kaboodle, I guess maybe that’s a necessary evil if we want type-checking for elements/attributes?
Either way, we can leave this for a future version, once the overall type-declarations are fully in place.
Issue Analytics
- State:
- Created 6 years ago
- Comments:13 (8 by maintainers)
Top Results From Across the Web
Documentation - Type Declarations - TypeScript
TypeScript includes declaration files for all of the standardized built-in APIs available in JavaScript runtimes. This includes things like methods and ...
Read more >A quick introduction to “Type Declaration” files and adding ...
A type declaration is just a declaration of a type such as an interface , a function or a class . You can...
Read more >TypeScript — Type Declaration Files | by Makesh Kumar
Type declaration files are the files with d.ts extension, where types were declared via interface or type . These declaration files have no...
Read more >Adding declarations file manually (TypeScript) - Stack Overflow
I created @types/<module_name> dir in my src and put there index.d.ts file with one line like above. It worked. – Vlad Ganshin. Mar...
Read more >How to add custom types into the TypeScript project - drag13.io
Tutorial how to add custom types (typings) for the third-party code into the TypeScript project or how to solve "could not find a...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yes, it totally does! 👍
Maybe after we are done making sure the current types are properly tested and we are done adding better docs.