izy521 / discord.io

A small, single-file library for creating DiscordApp clients from Node.js or the browser
https://discord.gg/0MvHMfHcTKVVmIGP
MIT License
535 stars 154 forks source link

Implicit any type in TypeScript typings for getAudioContext. #232

Closed retrixe closed 6 years ago

retrixe commented 6 years ago

https://github.com/izy521/discord.io/blob/a65e165c8cbdfc64a69d98e7bc6e25f490469086/typings/index.d.ts#L547

TypeScript is throwing an error saying that error and stream are undefined. If I can know the possible types of stream, I could create a pull request to fix this issue. (I assume error is a string?) The documentation does not say much in this regard.

retrixe commented 6 years ago

There is another issue where nick is not defined on member. I can make a pull request to fix this however.

DeadlyBrad42 commented 6 years ago

I just ran into the getAudioContext issue. I fixed it by changing (error, stream) => void to callbackFunc, to match the code around it... I'm not sure if that was the intent of the callBackFunc type, but the signatures match.

retrixe commented 6 years ago

It does not seem to be the intent of the type in question, and I am guessing the stream argument is either a Buffer or something else. Replacing it with any is against static typing principles, but yes, a temporary fix.

retrixe commented 6 years ago

I created #241 to fix this issue.