Open Sharcoux opened 4 years ago
Agreed! We could start adding doc comments and use eslint-plugin-jsdoc to validate them. Then the docs could be generated from that (and meanwhile, referred to in the source). I was also thinking it might make sense to put the documentation in the TypeScript types because that way the parameter and return types will also be documented.
Would you be up for working on that?
I don't mind documenting the part I understand, but I asked for documentation because most part remains obscure to me. I don't know much about TypeScript.
I don't mind documenting the part I understand, but I asked for documentation because most part remains obscure to me.
I'm in the same situation; we're learning as we go.
There is actually a bunch of documentation in https://github.com/zmxv/react-native-sound/blob/master/index.d.ts ; maybe that's not such a bad start!
Oh... So actually everything is already there. We just need to find out how to generate automated documentation from that?
This might be enough? https://typedoc.org/
Have you found any projects that use it?
:clipboard: Description
I think it would be great to have a full API documentation with all possible functions exposed by the Sound object, their parameters and their effect.
:microphone: Motivation
The current documentation is hard to read, and could lead to a massive loss of time both for developers coming here the first time, and maintainers that will have to answer questions.
:bulb: Alternatives
The
sound.js
file could be documented, leading to a better understanding of what the functions are actually doing. For instance, there is asetMode
function. Cool... What does it do? What kind of parameters are accepted? What modes can we set? And what aboutsetCategory
?