Androz2091 / discord-logs

📝Framework that simplify the usage of advanced Discord logs
239 stars 23 forks source link

Add typings of library events #59

Open Satont opened 3 years ago

Satont commented 3 years ago

I'm not sure do you need JSDoc for declare typings now, after i write types for each one event.

Maybe you will need test out https://typedoc.org/, who can generate docs from typings, but not sure it will works.

https://typedoc.org/guides/doccomments/#%40param-%3Cparam-name%3E

Says you not need declare type via JSDoc, description is enough there.

Androz2091 commented 3 years ago

Thank you! Yes, we should add a script generating the typings automatically. And do you know if the current typings will be overwritten?

import logs from 'discord-logs';
logs(client); // will we get an error here, as the new typings don't include this method?
Satont commented 3 years ago

Nope, it's not overwritten.

I just extend discord.js library typings for client.on

You can switch to my branch and open test.ts added by me.

Satont commented 3 years ago

Thats all, no other changes in typings, library.

Satont commented 3 years ago

Notice: each time you will add new events, you will need add typings in typings/index.d.ts file.

Androz2091 commented 3 years ago

I think I will make a script that will parse the jsdoc comments and update the typings automatically

Androz2091 commented 3 years ago

like the ones in the scripts folder

Satont commented 3 years ago

I think I will make a script that will parse the jsdoc comments and update the typings automatically

Yea, I had this idea in my mind. It might be solution there.