question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:open
  • Created 6 years ago
  • Comments:13 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
jorgebucarancommented, Nov 2, 2017

@mindplay-dk does pico support SVG?

Yes, it totally does! 👍

1reaction
jorgebucarancommented, Nov 7, 2017

I wonder if we should approach these other teams about that.

Maybe after we are done making sure the current types are properly tested and we are done adding better docs.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found