Skip to content
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

types: replace Mixins with interface merging #10094

Merged
merged 5 commits into from
Feb 11, 2024

Conversation

Qjuh
Copy link
Contributor

@Qjuh Qjuh commented Jan 21, 2024

Please describe the changes this PR makes and why it should be merged:

Replaces (Partial)TextBasedChannelMixin and (Partial)WebhookMixin with interface merging instead for better documentation while effectively offering the same types.

The DiscordjsErrorMixin isn't directly replaceable like this, because it narrows the name and code properties.

Status and versioning classification:

  • Code changes have been tested against the Discord API, or there are no code changes
  • I know how to update typings and have done so, or typings don't need updating

@Qjuh Qjuh requested a review from a team as a code owner January 21, 2024 13:47
Copy link

vercel bot commented Jan 21, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
discord-js ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 11, 2024 7:24pm
discord-js-guide ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 11, 2024 7:24pm

@Renegade334
Copy link
Contributor

While in the vicinity, might be worth changing the following to match the implementation:

  /** @internal */
  export interface DiscordjsErrorFields<Name extends string> {
-   readonly name: `${Name} [${DiscordjsErrorCodes}]`;
-   get code(): DiscordjsErrorCodes;
+   get name(): `${Name} [${DiscordjsErrorCodes}]`;
+   readonly code: DiscordjsErrorCodes;
  }

@Qjuh
Copy link
Contributor Author

Qjuh commented Jan 21, 2024

Feel free to make a PR. I don't like to mix unrelated stuff into this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants