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

[BUGFIX LTS] Fix the types for the mutation-methods of NativeArray #20327

Merged
merged 1 commit into from
Dec 21, 2022
Merged

[BUGFIX LTS] Fix the types for the mutation-methods of NativeArray #20327

merged 1 commit into from
Dec 21, 2022

Conversation

boris-petrov
Copy link
Contributor

It's really annoying that I can't do:

const array = [1, 2, 3] as readonly number[];
const other = A().setObjects(array); // same with `pushObjects`, `unshiftObjects`, `removeObjects` and `addObjects`

I believe this PR fixes that.

cc @chriskrycho

Copy link
Contributor

@chriskrycho chriskrycho left a comment

Choose a reason for hiding this comment

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

Thanks!

types/preview/@ember/array/-private/native-array.d.ts Outdated Show resolved Hide resolved
types/preview/@ember/array/-private/native-array.d.ts Outdated Show resolved Hide resolved
types/preview/@ember/array/-private/native-array.d.ts Outdated Show resolved Hide resolved
@chriskrycho chriskrycho added Bug TypeScript Work on Ember’s types labels Dec 21, 2022
@chriskrycho chriskrycho merged commit 5cb0cc9 into emberjs:master Dec 21, 2022
@boris-petrov boris-petrov deleted the fix-native-array-mutation-method-types branch December 21, 2022 21:09
@chriskrycho chriskrycho changed the title Fix the types for the mutation-methods of NativeArray [BUGFIX LTS] Fix the types for the mutation-methods of NativeArray Dec 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug TypeScript Work on Ember’s types
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants