Skip to content

Commit cc08c3d

Browse files
AljulluAljulluyouknowriad
authored andcommitted
Add typing to iAPI's getConfig() (WordPress#71692)
Co-authored-by: Aljullu <aljullu@git.wordpress.org> Co-authored-by: youknowriad <youknowriad@git.wordpress.org>
1 parent 6f2ef2c commit cc08c3d

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

‎packages/interactivity/CHANGELOG.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## Unreleased
44

5+
### Enhancements
6+
7+
- `getConfig` accepts a type parameter describing the config it returns, like `getContext` does, so consumers can read typed config values. It defaults to `any`, so existing calls are unaffected ([#71692](https://github.com/WordPress/gutenberg/pull/71692)).
8+
59
## 6.56.0 (2026-09-23)
610

711
## 6.55.0 (2026-09-10)

‎packages/interactivity/src/store.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const serverStates = new Map();
1515
* @param namespace Store's namespace from which to retrieve the config.
1616
* @return Defined config for the given namespace.
1717
*/
18-
export const getConfig = ( namespace?: string ) =>
18+
export const getConfig = < T extends object = any >( namespace?: string ): T =>
1919
storeConfigs.get( namespace || getNamespace() ) || {};
2020

2121
/**

0 commit comments

Comments
 (0)