feather
feather copied to clipboard
add TS declaration file
Prerequisites
- Version: latest
- Are you running from source/master: npm
- Are you using a released build: yes
- Operating system: macOS
- Bits: ?
Step to reproduce
npm i feather-icons
import feather from 'feather-icons'
Actual behavior
doesn't have a declaration file
Any message or error
Could not find a declaration file for module 'feather-icons'. '/frontend/node_modules/feather-icons/dist/feather.js' implicitly has an 'any' type. Try
npm install @types/feather-icons
if it exists or add a new declaration (.d.ts) file containingdeclare module 'feather-icons';
ts(7016)
Resources
- Links
- Screenshots
- Bits: ?
Means your processor's bits (most likely 64 bits on macOS)
You can install @types/feather-icons
to get the type definitions 🙂
But isn't it better if that file is bundled with the actual library?
I also believe that the icon name should be a string literal with only possible icon names.
The current types don't offer much help in that regard:
This means that there's no autocomplete for icon names atm, and I don't know when I misspelled one.
I just want to say that the FeatherAttributes
also is very vague. It's not clear to me knowing what options there are just using typescript.
I want to stress again how difficult it is to work with the possible options to pass.
FeatherAttributes
gives no guidance on how this options object should look whatsoever.
+1