Skip to content

iAPI: Export NavigateOptions and PrefetchOptions types #70315

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

Merged
merged 2 commits into from
Jun 5, 2025

Conversation

DAreRodz
Copy link
Contributor

@DAreRodz DAreRodz commented Jun 4, 2025

What?

This PR exports NavigateOptions and PrefetchOptions types from interactivity-router.

Props to @dinhtungdu

Why?

If @wordpress/interactivity-router is used in a store, and the store's type is exported, developers will need the two types mentioned above exported. Otherwise, TypeScript will fail to figure out the shape of them.

How?

This PR exports needed type so TS can determine the shape of actions.navigate() and actions.prefetch() arguments

Copy link

github-actions bot commented Jun 4, 2025

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: dinhtungdu <dinhtungdu@git.wordpress.org>
Co-authored-by: DAreRodz <darerodz@git.wordpress.org>
Co-authored-by: luisherranz <luisherranz@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@DAreRodz DAreRodz added [Type] Enhancement A suggestion for improvement. [Feature] Interactivity API API to add frontend interactivity to blocks. [Package] Interactivity Router /packages/interactivity-router labels Jun 4, 2025
@DAreRodz DAreRodz requested a review from luisherranz June 4, 2025 15:16
Copy link
Contributor

@dinhtungdu dinhtungdu left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! This is LGTM!

@DAreRodz DAreRodz merged commit bd7ea30 into trunk Jun 5, 2025
61 of 62 checks passed
@DAreRodz DAreRodz deleted the update/export-interactivity-router-types branch June 5, 2025 09:58
@github-actions github-actions bot added this to the Gutenberg 21.1 milestone Jun 5, 2025
chriszarate pushed a commit to chriszarate/gutenberg that referenced this pull request Jul 1, 2025
…#70315)

* Export NavigateOptions and PrefetchOptions for using interactivity-router in TypeScript

* Update changelog

---------

Co-authored-by: dinhtungdu <dinhtungdu@git.wordpress.org>
Co-authored-by: DAreRodz <darerodz@git.wordpress.org>
Co-authored-by: luisherranz <luisherranz@git.wordpress.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Interactivity API API to add frontend interactivity to blocks. [Package] Interactivity Router /packages/interactivity-router [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants