discord.js
discord.js copied to clipboard
Type currently unknown `toJSON()` methods
Which package is this feature request for?
discord.js
Feature
Right now there are some structures (Guild, Application, Client, GuildMember etc...) where their JSON
type is marked as unknown
. This makes it frustrating when you need to provide them to external JSON sources with their respective types
Ideal solution or implementation
An internal JSON type that flattens all required fields accordingly and replaces current toJSON()
marked as unknown
Alternative solutions or implementations
A public JSON<T>
type helper (such as this) that receives a generic and Flattens it accordingly.
Other context
No response