Closed vahdet closed 4 years ago
Hi @vahdet thanks for the suggestion. I have no experience with TypeScript (though it is of interest to me), so you may be better positioned to contribute a declaration file than me. If you make a PR for this, I can advise on the types and shape of the inputs/outputs.
You probably don't even need to do the whole thing - if you get it started and help me get an idea of how to structure and publish a declaration file, I can probably fill in the missing definitions.
@JamesBrill Well, yesterday I tinkered with the code indeed. I forked the repo applied my work on a new branch feature/typecript-support
. I have some experience with TypeScript, but cannot call myself a master of it. Anyways, I am sending a PR w/ my further explanation on what I've done; and then, improvements can be done on it (see: https://github.com/JamesBrill/react-speech-recognition/pull/52)
I won't be around for a couple of weeks, so I may react slower than today..
@vahdet @JamesBrill @types/react-speech-recognition
is now available.
Thank you @OleksandrYehorov - that is hugely appreciated. 🙇
Firstly, thanks for the promising work! In my case, the basic import (
import SpeechRecognition, { useSpeechRecognition } from 'react-speech-recognition'
) fails the TypeScript check with code ts(7016):And
npm install @types/react-speech-recognition
throws:So, I had to workaround it with adding this in my
app.d.ts file
:So, do you have any agenda for adding TypeScript support? If needed, I also may contribute at my best effort.