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

feat(LimitedCollection): export LimitedCollection #6043

Merged
merged 4 commits into from Jul 5, 2021

Conversation

PanSzelescik
Copy link
Contributor

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

Closes #4274, I don't know why it isn't exported

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
  • This PR changes the library's interface (methods or parameters added)

@vladfrangu vladfrangu requested review from kyranet, iCrawl and SpaceEEC and removed request for kyranet and iCrawl July 4, 2021 21:30
@ckohen
Copy link
Member

ckohen commented Jul 4, 2021

Please remove the @private docstring in the file

@PanSzelescik
Copy link
Contributor Author

Please remove the @private docstring in the file

Removed

@iCrawl iCrawl added this to the Version 13 milestone Jul 4, 2021
@PanSzelescik
Copy link
Contributor Author

Should I add typings in Collections region?

Copy link
Member

@SpaceEEC SpaceEEC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is still the issue with implicitly creating new instances of LimitedCollection through its methods, e.g. clone, filter.
TS will say those are LimitedCollections, but they actually are Collections.
(Creating new LimitedCollections is not possible without modifying Collection and thinking of a way to derive new arbitrary child instances)

I don't know of a way to make TS aware of Symbol.species and overwriting all methods to specify that actually a Collection is returned is error prone and tedious.

So I suppose 🤷

@SpaceEEC
Copy link
Member

SpaceEEC commented Jul 5, 2021

Yeah, moving the declaration for LimitedCollection would be nice, @PanSzelescik.

@iCrawl
Copy link
Member

iCrawl commented Jul 5, 2021

This needs a rebase.

@iCrawl iCrawl merged commit 31d3129 into discordjs:master Jul 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

LimitedCollection
6 participants