muaz-khan / RecordRTC

RecordRTC is WebRTC JavaScript library for audio/video as well as screen activity recording. It supports Chrome, Firefox, Opera, Android, and Microsoft Edge. Platforms: Linux, Mac and Windows.
https://www.webrtc-experiment.com/RecordRTC/
MIT License
6.58k stars 1.76k forks source link

feat: provide typescript definition file #582

Open bruceauyeung opened 4 years ago

bruceauyeung commented 4 years ago

thanks for this great lib ! it looks lack of official typescript definition file, and i also searched in http://definitelytyped.org but found nothing.

davehowson commented 4 years ago

I need this as well

snakenstein commented 4 years ago

any plans on providing typescript definitions?

k-yle commented 4 years ago

I've submitted typescript definitions for RecordRTC to DefinitelyTyped 🎉

see https://github.com/DefinitelyTyped/DefinitelyTyped/pull/46333

@­me over there if I've made any mistakes

jbuckland-veridas commented 3 years ago

Hi @k-yle!! I have successfully installed your definition file in my ts project, but there is something that im doing wrong cause when i install recordrtc and @types/recordrtc both in version 5.6.2, i cant use recordrtc correctly, when i check the path of recordrtc module it points to your index.d.ts file and recordrtc throws an error when i try to use it as a constructor or function, i have tried 2 ways with and without new keyword, if i remove your types installation then the linter complains. ¿someone with the same problem over here?

k-yle commented 3 years ago

Hi @jbuckland-veridas, you'll need to turn on esModuleInterop in you're tsconfig file (It's generally a good idea to have this enabled).

If you're interested, here's a lengthy explanation on what it does