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

fix(ext/web): Fix structuredClone Web API type declaration (any -> generic) #22968

Merged
merged 4 commits into from Mar 25, 2024

Conversation

viktormarinho
Copy link
Contributor

References Issue #22958

Hello! the current structuredClone function declaration uses any. This PR changes it to use a generic type that fallbacks to any.

If there is need to change this in another place, or some reason for not doing this please inform me.

Used the same type as in: https://github.com/microsoft/TypeScript/blob/main/src/lib/dom.generated.d.ts#L26114

@CLAassistant
Copy link

CLAassistant commented Mar 18, 2024

CLA assistant check
All committers have signed the CLA.

@bartlomieju bartlomieju added this to the 1.42 milestone Mar 21, 2024
@bartlomieju
Copy link
Member

Thanks for the PR @viktormarinho. I think we need to update the self.structuredClone test in tests/unit/structure_clone_test.ts to say:

.structuredClone([arrayOriginal, channelOriginal.port2] as [string[], MessagePort], {

To make TS happy. Can you apply that change?

Signed-off-by: Viktor Marinho <56888067+viktormarinho@users.noreply.github.com>
@viktormarinho
Copy link
Contributor Author

@bartlomieju done!

Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

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

Thanks!

@bartlomieju bartlomieju merged commit fb1aa4e into denoland:main Mar 25, 2024
17 checks passed
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.

None yet

3 participants