You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This would allow us to do message.guild.settings.get(GuildSettings.Prefix); and get string as return type, likewise message.guild.settings.get(GuildSettings.Roles.Public); would get readonly string[] as return type.
So essentially we can forget about the headache of having to do message.guild.settings.get(GuildSettings.Roles.Public) as GuildSettings.Roles.Public; which I often declare as an argument to improve code readability.
The text was updated successfully, but these errors were encountered:
Technically, it's completely possible to overload it so it takes a special interface, as used by Node.js's
util.promisify
:CustomPromisify
definition:https://github.com/DefinitelyTyped/DefinitelyTyped/blob/3ef1069095013311df0fc6df1cb1ba92c220be19/types/node/util.d.ts#L57-L59
CustomPromisify
overload usage:https://github.com/DefinitelyTyped/DefinitelyTyped/blob/3ef1069095013311df0fc6df1cb1ba92c220be19/types/node/util.d.ts#L86
Usage examples:
https://github.com/DefinitelyTyped/DefinitelyTyped/blob/3ef1069095013311df0fc6df1cb1ba92c220be19/types/node/fs.d.ts#L864-L892
This would allow us to do
message.guild.settings.get(GuildSettings.Prefix);
and getstring
as return type, likewisemessage.guild.settings.get(GuildSettings.Roles.Public);
would getreadonly string[]
as return type.So essentially we can forget about the headache of having to do
message.guild.settings.get(GuildSettings.Roles.Public) as GuildSettings.Roles.Public;
which I often declare as an argument to improve code readability.The text was updated successfully, but these errors were encountered: