feather icon indicating copy to clipboard operation
feather copied to clipboard

add TS declaration file

Open mesqueeb opened this issue 4 years ago • 6 comments

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 containing declare module 'feather-icons';ts(7016)

Resources

  • Links
  • Screenshots Screenshot 2020-04-30 at 16 56 21

mesqueeb avatar Apr 30 '20 07:04 mesqueeb

  • Bits: ?

Means your processor's bits (most likely 64 bits on macOS)

moeenio avatar Apr 30 '20 08:04 moeenio

You can install @types/feather-icons to get the type definitions 🙂

colebemis avatar Apr 30 '20 17:04 colebemis

But isn't it better if that file is bundled with the actual library?

mesqueeb avatar May 01 '20 03:05 mesqueeb

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: image

This means that there's no autocomplete for icon names atm, and I don't know when I misspelled one.

mesqueeb avatar May 13 '20 07:05 mesqueeb

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.

mesqueeb avatar Apr 11 '21 06:04 mesqueeb

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.

mesqueeb avatar Aug 24 '21 23:08 mesqueeb

+1

tno2007 avatar Jul 24 '23 13:07 tno2007