New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Typescript type for all id's in the generated sprite #731
Comments
Hello. The thing is that all icons and icons names are generated in runtime. On the other hand, TS is an superset of JS, the type checking takes place on compilation time. |
@Kreeg But I think what he wants is generating the interface at runtime, so he will have autocomplete inside the ide. That should be quite easy. @AlexisWalravens This package does it but doesn't have all the features of svg-sprite https://github.com/kreuzerk/svg-to-ts |
Hi 馃憢,
I recently started using this project, wich is great to build sprite with no hassle!
I don't have any issue, it's more of an idea.
In my project I use React and Typescript.
I created a
Icon
component which takes aname
prop which should be the id of the svg in the sprite I want to use.And it works great, but miss one thing. Using typescript it would be amazing to be able to generate a type declaration that would contain all of the id of the svg in the sprite so I would get autocompletion for my
name
prop and I would be able to create my interface like this:What do you think ?
The text was updated successfully, but these errors were encountered: