-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
refactor: use interfaces for AsyncEventEmitter event maps #10044
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 2 Ignored Deployments
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #10044 +/- ##
==========================================
+ Coverage 58.34% 58.36% +0.02%
==========================================
Files 241 241
Lines 17158 17168 +10
Branches 1242 1242
==========================================
+ Hits 10010 10020 +10
Misses 7103 7103
Partials 45 45
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unless you had a specific reason in mind for not doing this, please also change the generics in extends to the initial interface so the empty extends can be removed easily in the next major.
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [@discordjs/rest](https://discord.js.org) ([source](https://github.com/discordjs/discord.js)) | dependencies | minor | [`2.2.0` -> `2.3.0`](https://renovatebot.com/diffs/npm/@discordjs%2frest/2.2.0/2.3.0) | --- ### Release Notes <details> <summary>discordjs/discord.js (@​discordjs/rest)</summary> ### [`v2.3.0`](https://github.com/discordjs/discord.js/blob/HEAD/packages/rest/CHANGELOG.md#discordjsrest230---2024-05-04) [Compare Source](https://github.com/discordjs/discord.js/compare/@discordjs/[email protected]...@discordjs/[email protected]) #### Bug Fixes - Anchor link for events ([0efd1be](discordjs/discord.js@0efd1be)) #### Documentation - Split docs.api.json into multiple json files ([597340f](discordjs/discord.js@597340f)) - Remove hyphen after `@returns` ([#​9989](discordjs/discord.js#9989)) ([e9ff991](discordjs/discord.js@e9ff991)) #### Features - Local and preview detection ([79fbda3](discordjs/discord.js@79fbda3)) - **REST:** Dynamic rate limit offsets ([#​10099](discordjs/discord.js#10099)) ([278396e](discordjs/discord.js@278396e)) #### Refactor - Docs ([#​10126](discordjs/discord.js#10126)) ([18cce83](discordjs/discord.js@18cce83)) - Use interfaces for AsyncEventEmitter event maps ([#​10044](discordjs/discord.js#10044)) ([adfd9cd](discordjs/discord.js@adfd9cd)) #### Styling - Fix up lint ([d869d9b](discordjs/discord.js@d869d9b)) #### Testing - Skip flaky rest test ([#​10234](discordjs/discord.js#10234)) ([dc8f149](discordjs/discord.js@dc8f149)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4wLjAiLCJ1cGRhdGVkSW5WZXIiOiIzNy4wLjAiLCJ0YXJnZXRCcmFuY2giOiJkZXZlbG9wIn0=--> Reviewed-on: https://git.vylpes.xyz/External/card-drop/pulls/232 Reviewed-by: Vylpes <[email protected]> Co-authored-by: Renovate Bot <[email protected]> Co-committed-by: Renovate Bot <[email protected]>
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [@discordjs/rest](https://discord.js.org) ([source](https://github.com/discordjs/discord.js)) | dependencies | minor | [`2.2.0` -> `2.3.0`](https://renovatebot.com/diffs/npm/@discordjs%2frest/2.2.0/2.3.0) | --- ### Release Notes <details> <summary>discordjs/discord.js (@​discordjs/rest)</summary> ### [`v2.3.0`](https://github.com/discordjs/discord.js/blob/HEAD/packages/rest/CHANGELOG.md#discordjsrest230---2024-05-04) [Compare Source](https://github.com/discordjs/discord.js/compare/@discordjs/[email protected]...@discordjs/[email protected]) #### Bug Fixes - Anchor link for events ([0efd1be](discordjs/discord.js@0efd1be)) #### Documentation - Split docs.api.json into multiple json files ([597340f](discordjs/discord.js@597340f)) - Remove hyphen after `@returns` ([#​9989](discordjs/discord.js#9989)) ([e9ff991](discordjs/discord.js@e9ff991)) #### Features - Local and preview detection ([79fbda3](discordjs/discord.js@79fbda3)) - **REST:** Dynamic rate limit offsets ([#​10099](discordjs/discord.js#10099)) ([278396e](discordjs/discord.js@278396e)) #### Refactor - Docs ([#​10126](discordjs/discord.js#10126)) ([18cce83](discordjs/discord.js@18cce83)) - Use interfaces for AsyncEventEmitter event maps ([#​10044](discordjs/discord.js#10044)) ([adfd9cd](discordjs/discord.js@adfd9cd)) #### Styling - Fix up lint ([d869d9b](discordjs/discord.js@d869d9b)) #### Testing - Skip flaky rest test ([#​10234](discordjs/discord.js#10234)) ([dc8f149](discordjs/discord.js@dc8f149)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4wLjAiLCJ1cGRhdGVkSW5WZXIiOiIzNy4wLjAiLCJ0YXJnZXRCcmFuY2giOiJkZXZlbG9wIn0=--> Reviewed-on: https://git.vylpes.xyz/RabbitLabs/vylbot-app/pulls/435 Reviewed-by: Vylpes <[email protected]> Co-authored-by: Renovate Bot <[email protected]> Co-committed-by: Renovate Bot <[email protected]>
Please describe the changes this PR makes and why it should be merged:
Turn the mapped types for events in
rest/REST
,ws/WebSocketManager,
ws/WebSocketShard
andcore/Client
into interfaces for better documentation purposes.Also turns
WebSocketManagerOptions
into an interface for the same reason.Some interfaces are simple aliases of already existing interfaces, to keep the named export and make this possible as a non-breaking change even in TS land.
@discordjs/brokers
still uses types for event maps, but they are dynamic so not as easily adjustable.Status and versioning classification: