-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(Types): export more types #6808
Conversation
Bit annoying that without this we have to copy over types to our own code so lets just export them I did a check with /^type / to find any not yet exported types, after this PR everything is exported
@favna just curious, in what scenarios do you need to use these types yourself? |
Defining function parsePresenceActivity(): ActivitiesOptions[] {
const { CLIENT_PRESENCE_NAME } = process.env;
if (!CLIENT_PRESENCE_NAME) return [];
return [
{
name: CLIENT_PRESENCE_NAME,
type: envParseString('CLIENT_PRESENCE_TYPE', 'LISTENING') as ExcludeEnum<typeof ActivityTypes, 'CUSTOM'>
}
];
} The collector ones: https://github.com/almostSouji/yuudachi/blob/08cb404b4dece3a09ced34463ae2ea95b5749f2a/src/util/awaitComponent.ts |
For your example you can easily do |
Doesn't matter. That's not an argument to not export the types. Besides, hate to be the one to give you a reality check, but you're not a maintainer so it's up to people like Souji, Crawl, Kyra and co to make the call whether they want to merge this and considering Souji specifically asked me to make the collector changes... well you do the math. |
I know, I'm just voicing my opinion as I don't think that a discord API library should be exporting generic type utilities because it seems quite out of the scope of the package. There are other alternatives that work just as fine like the one I just mentioned but I know it's up to them in the end to say whether to merge this or not, I just think it's a bad idea |
Please describe the changes this PR makes and why it should be merged:
Bit annoying that without this we have to copy over types to our own code so lets just export them. Personally (and some other Sapphire users) ran into
ExcludeEnum
, Souji asked me to also export the collector ones for Yuu.Then I figured, might as well do a check with
/^type /
to find any not yet exported types, after this PR everything is exportedStatus and versioning classification: