micnews / react-jw-player

A React Component API for JW Player
195 stars 95 forks source link

Typescript support #104

Open BoazKG93 opened 5 years ago

BoazKG93 commented 5 years ago

I'm trying to use this component in a typescript React project. This is not working, giving me the following error:

Could not find a declaration file for module 'react-jw-player'. '/Users/boazkerengil/Sparks/client-panel/node_modules/react-jw-player/dist/react-jw-player.js' implicitly has an 'any' type.
  Try `npm install @types/react-jw-player` if it exists or add a new declaration (.d.ts) file containing `declare module 'react-jw-player';`

I tried to do it with require and also with import * as but both of them won't work. Is it possible to get @types support in the near future? and if not, what is the best way I should approuch this?

ellell commented 5 years ago

@BoazKG93 we're not using typescript so that's why support for this haven't been added yet. Gladly accept PRs if you want to add type definitions though!

danmakenoise commented 5 years ago

@BoazKG93 I believe you could make a pr to https://github.com/DefinitelyTyped/DefinitelyTyped that includes Typescript types for our library, if you are interested! Adding the help wanted tag on this one.

igoramos77 commented 3 years ago

I'm trying to use this component in a typescript React project. This is not working, giving me the following error:

Could not find a declaration file for module 'react-jw-player'. '/Users/boazkerengil/Sparks/client-panel/node_modules/react-jw-player/dist/react-jw-player.js' implicitly has an 'any' type.
  Try `npm install @types/react-jw-player` if it exists or add a new declaration (.d.ts) file containing `declare module 'react-jw-player';`

I tried to do it with require and also with import * as but both of them won't work. Is it possible to get @types support in the near future? and if not, what is the best way I should approuch this?

Hello, BoazKG93! Did you manage to solve it?

I really need to add @types to my project