@wordpress/data 10.41.0 → 10.41.1-next.v.202603102151.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (213) hide show
  1. package/README.md +20 -28
  2. package/build/components/async-mode-provider/context.cjs +1 -1
  3. package/build/components/async-mode-provider/context.cjs.map +3 -3
  4. package/build/components/async-mode-provider/index.cjs +1 -1
  5. package/build/components/async-mode-provider/index.cjs.map +1 -1
  6. package/build/components/async-mode-provider/use-async-mode.cjs +1 -1
  7. package/build/components/async-mode-provider/use-async-mode.cjs.map +3 -3
  8. package/build/components/registry-provider/context.cjs +1 -1
  9. package/build/components/registry-provider/context.cjs.map +1 -1
  10. package/build/components/registry-provider/index.cjs +1 -1
  11. package/build/components/registry-provider/index.cjs.map +1 -1
  12. package/build/components/registry-provider/use-registry.cjs +1 -1
  13. package/build/components/registry-provider/use-registry.cjs.map +3 -3
  14. package/build/components/use-dispatch/index.cjs +1 -1
  15. package/build/components/use-dispatch/index.cjs.map +1 -1
  16. package/build/components/use-dispatch/use-dispatch-with-map.cjs +1 -1
  17. package/build/components/use-dispatch/use-dispatch-with-map.cjs.map +3 -3
  18. package/build/components/use-dispatch/use-dispatch.cjs +1 -1
  19. package/build/components/use-dispatch/use-dispatch.cjs.map +3 -3
  20. package/build/components/use-select/index.cjs +2 -2
  21. package/build/components/use-select/index.cjs.map +3 -3
  22. package/build/components/with-dispatch/index.cjs +1 -1
  23. package/build/components/with-dispatch/index.cjs.map +3 -3
  24. package/build/components/with-registry/index.cjs +1 -1
  25. package/build/components/with-registry/index.cjs.map +3 -3
  26. package/build/components/with-select/index.cjs +1 -1
  27. package/build/components/with-select/index.cjs.map +3 -3
  28. package/build/controls.cjs +7 -6
  29. package/build/controls.cjs.map +3 -3
  30. package/build/default-registry.cjs +3 -2
  31. package/build/default-registry.cjs.map +3 -3
  32. package/build/dispatch.cjs +3 -1
  33. package/build/dispatch.cjs.map +2 -2
  34. package/build/factory.cjs.map +2 -2
  35. package/build/index.cjs +9 -8
  36. package/build/index.cjs.map +3 -3
  37. package/build/plugins/index.cjs +1 -1
  38. package/build/plugins/index.cjs.map +1 -1
  39. package/build/plugins/persistence/index.cjs +13 -8
  40. package/build/plugins/persistence/index.cjs.map +3 -3
  41. package/build/plugins/persistence/storage/default.cjs +1 -1
  42. package/build/plugins/persistence/storage/default.cjs.map +3 -3
  43. package/build/plugins/persistence/storage/object.cjs +1 -1
  44. package/build/plugins/persistence/storage/object.cjs.map +3 -3
  45. package/build/promise-middleware.cjs +2 -1
  46. package/build/promise-middleware.cjs.map +3 -3
  47. package/build/redux-store/index.cjs +32 -16
  48. package/build/redux-store/index.cjs.map +3 -3
  49. package/build/redux-store/metadata/selectors.cjs +1 -1
  50. package/build/redux-store/metadata/selectors.cjs.map +3 -3
  51. package/build/redux-store/metadata/types.cjs +19 -0
  52. package/build/redux-store/metadata/types.cjs.map +7 -0
  53. package/build/registry.cjs +11 -7
  54. package/build/registry.cjs.map +3 -3
  55. package/build/resolvers-cache-middleware.cjs +6 -3
  56. package/build/resolvers-cache-middleware.cjs.map +3 -3
  57. package/build/select.cjs +3 -1
  58. package/build/select.cjs.map +2 -2
  59. package/build/store/index.cjs +1 -1
  60. package/build/store/index.cjs.map +3 -3
  61. package/build/types.cjs.map +1 -1
  62. package/build-module/components/async-mode-provider/context.mjs +1 -1
  63. package/build-module/components/async-mode-provider/context.mjs.map +3 -3
  64. package/build-module/components/async-mode-provider/index.mjs +1 -1
  65. package/build-module/components/async-mode-provider/index.mjs.map +1 -1
  66. package/build-module/components/async-mode-provider/use-async-mode.mjs +1 -1
  67. package/build-module/components/async-mode-provider/use-async-mode.mjs.map +3 -3
  68. package/build-module/components/registry-provider/context.mjs +1 -1
  69. package/build-module/components/registry-provider/context.mjs.map +1 -1
  70. package/build-module/components/registry-provider/index.mjs +1 -1
  71. package/build-module/components/registry-provider/index.mjs.map +1 -1
  72. package/build-module/components/registry-provider/use-registry.mjs +1 -1
  73. package/build-module/components/registry-provider/use-registry.mjs.map +3 -3
  74. package/build-module/components/use-dispatch/index.mjs +1 -1
  75. package/build-module/components/use-dispatch/index.mjs.map +1 -1
  76. package/build-module/components/use-dispatch/use-dispatch-with-map.mjs +1 -1
  77. package/build-module/components/use-dispatch/use-dispatch-with-map.mjs.map +3 -3
  78. package/build-module/components/use-dispatch/use-dispatch.mjs +1 -1
  79. package/build-module/components/use-dispatch/use-dispatch.mjs.map +3 -3
  80. package/build-module/components/use-select/index.mjs +2 -2
  81. package/build-module/components/use-select/index.mjs.map +3 -3
  82. package/build-module/components/with-dispatch/index.mjs +1 -1
  83. package/build-module/components/with-dispatch/index.mjs.map +3 -3
  84. package/build-module/components/with-registry/index.mjs +1 -1
  85. package/build-module/components/with-registry/index.mjs.map +3 -3
  86. package/build-module/components/with-select/index.mjs +1 -1
  87. package/build-module/components/with-select/index.mjs.map +3 -3
  88. package/build-module/controls.mjs +7 -6
  89. package/build-module/controls.mjs.map +3 -3
  90. package/build-module/default-registry.mjs +3 -2
  91. package/build-module/default-registry.mjs.map +3 -3
  92. package/build-module/dispatch.mjs +3 -1
  93. package/build-module/dispatch.mjs.map +2 -2
  94. package/build-module/factory.mjs.map +2 -2
  95. package/build-module/index.mjs +4 -3
  96. package/build-module/index.mjs.map +2 -2
  97. package/build-module/plugins/index.mjs +1 -1
  98. package/build-module/plugins/index.mjs.map +1 -1
  99. package/build-module/plugins/persistence/index.mjs +13 -8
  100. package/build-module/plugins/persistence/index.mjs.map +3 -3
  101. package/build-module/plugins/persistence/storage/default.mjs +1 -1
  102. package/build-module/plugins/persistence/storage/default.mjs.map +3 -3
  103. package/build-module/plugins/persistence/storage/object.mjs +1 -1
  104. package/build-module/plugins/persistence/storage/object.mjs.map +3 -3
  105. package/build-module/promise-middleware.mjs +2 -1
  106. package/build-module/promise-middleware.mjs.map +3 -3
  107. package/build-module/redux-store/index.mjs +32 -16
  108. package/build-module/redux-store/index.mjs.map +3 -3
  109. package/build-module/redux-store/metadata/selectors.mjs +1 -1
  110. package/build-module/redux-store/metadata/selectors.mjs.map +3 -3
  111. package/build-module/redux-store/metadata/types.mjs +1 -0
  112. package/build-module/redux-store/metadata/types.mjs.map +7 -0
  113. package/build-module/registry.mjs +11 -7
  114. package/build-module/registry.mjs.map +3 -3
  115. package/build-module/resolvers-cache-middleware.mjs +6 -3
  116. package/build-module/resolvers-cache-middleware.mjs.map +3 -3
  117. package/build-module/select.mjs +3 -1
  118. package/build-module/select.mjs.map +2 -2
  119. package/build-module/store/index.mjs +1 -1
  120. package/build-module/store/index.mjs.map +3 -3
  121. package/build-types/components/async-mode-provider/context.d.ts +37 -3
  122. package/build-types/components/async-mode-provider/context.d.ts.map +1 -1
  123. package/build-types/components/async-mode-provider/index.d.ts +2 -2
  124. package/build-types/components/async-mode-provider/index.d.ts.map +1 -1
  125. package/build-types/components/async-mode-provider/use-async-mode.d.ts.map +1 -1
  126. package/build-types/components/registry-provider/context.d.ts +10 -3
  127. package/build-types/components/registry-provider/context.d.ts.map +1 -1
  128. package/build-types/components/registry-provider/index.d.ts +2 -2
  129. package/build-types/components/registry-provider/index.d.ts.map +1 -1
  130. package/build-types/components/registry-provider/use-registry.d.ts +3 -2
  131. package/build-types/components/registry-provider/use-registry.d.ts.map +1 -1
  132. package/build-types/components/use-dispatch/index.d.ts +2 -2
  133. package/build-types/components/use-dispatch/index.d.ts.map +1 -1
  134. package/build-types/components/use-dispatch/use-dispatch-with-map.d.ts +11 -9
  135. package/build-types/components/use-dispatch/use-dispatch-with-map.d.ts.map +1 -1
  136. package/build-types/components/use-dispatch/use-dispatch.d.ts +10 -19
  137. package/build-types/components/use-dispatch/use-dispatch.d.ts.map +1 -1
  138. package/build-types/components/use-select/index.d.ts +24 -28
  139. package/build-types/components/use-select/index.d.ts.map +1 -1
  140. package/build-types/components/with-dispatch/index.d.ts +10 -11
  141. package/build-types/components/with-dispatch/index.d.ts.map +1 -1
  142. package/build-types/components/with-registry/index.d.ts +2 -6
  143. package/build-types/components/with-registry/index.d.ts.map +1 -1
  144. package/build-types/components/with-select/index.d.ts +7 -8
  145. package/build-types/components/with-select/index.d.ts.map +1 -1
  146. package/build-types/controls.d.ts +57 -44
  147. package/build-types/controls.d.ts.map +1 -1
  148. package/build-types/default-registry.d.ts +2 -2
  149. package/build-types/default-registry.d.ts.map +1 -1
  150. package/build-types/dispatch.d.ts +4 -0
  151. package/build-types/dispatch.d.ts.map +1 -1
  152. package/build-types/factory.d.ts +2 -1
  153. package/build-types/factory.d.ts.map +1 -1
  154. package/build-types/index.d.ts.map +1 -1
  155. package/build-types/plugins/index.d.ts +1 -1
  156. package/build-types/plugins/index.d.ts.map +1 -1
  157. package/build-types/plugins/persistence/index.d.ts +38 -27
  158. package/build-types/plugins/persistence/index.d.ts.map +1 -1
  159. package/build-types/plugins/persistence/storage/default.d.ts +7 -1
  160. package/build-types/plugins/persistence/storage/default.d.ts.map +1 -1
  161. package/build-types/plugins/persistence/storage/object.d.ts +4 -5
  162. package/build-types/plugins/persistence/storage/object.d.ts.map +1 -1
  163. package/build-types/promise-middleware.d.ts +6 -4
  164. package/build-types/promise-middleware.d.ts.map +1 -1
  165. package/build-types/redux-store/index.d.ts +12 -15
  166. package/build-types/redux-store/index.d.ts.map +1 -1
  167. package/build-types/redux-store/metadata/selectors.d.ts +45 -50
  168. package/build-types/redux-store/metadata/selectors.d.ts.map +1 -1
  169. package/build-types/redux-store/metadata/types.d.ts +48 -0
  170. package/build-types/redux-store/metadata/types.d.ts.map +1 -0
  171. package/build-types/registry.d.ts +5 -49
  172. package/build-types/registry.d.ts.map +1 -1
  173. package/build-types/resolvers-cache-middleware.d.ts +13 -7
  174. package/build-types/resolvers-cache-middleware.d.ts.map +1 -1
  175. package/build-types/select.d.ts +3 -0
  176. package/build-types/select.d.ts.map +1 -1
  177. package/build-types/store/index.d.ts +5 -12
  178. package/build-types/store/index.d.ts.map +1 -1
  179. package/build-types/types.d.ts +201 -10
  180. package/build-types/types.d.ts.map +1 -1
  181. package/package.json +9 -9
  182. package/src/components/async-mode-provider/{context.js → context.ts} +0 -1
  183. package/src/components/async-mode-provider/{use-async-mode.js → use-async-mode.ts} +1 -1
  184. package/src/components/registry-provider/{use-registry.js → use-registry.ts} +3 -2
  185. package/src/components/use-dispatch/{use-dispatch-with-map.js → use-dispatch-with-map.ts} +18 -9
  186. package/src/components/use-dispatch/{use-dispatch.js → use-dispatch.ts} +25 -20
  187. package/src/components/use-select/{index.js → index.ts} +84 -70
  188. package/src/components/with-dispatch/{index.js → index.tsx} +20 -13
  189. package/src/components/with-registry/{index.js → index.tsx} +1 -5
  190. package/src/components/with-select/{index.js → index.tsx} +17 -10
  191. package/src/{controls.js → controls.ts} +53 -26
  192. package/src/{default-registry.js → default-registry.ts} +3 -1
  193. package/src/dispatch.ts +7 -1
  194. package/src/factory.ts +4 -3
  195. package/src/index.ts +4 -8
  196. package/src/plugins/persistence/{index.js → index.ts} +93 -54
  197. package/src/plugins/persistence/storage/{default.js → default.ts} +3 -2
  198. package/src/plugins/persistence/storage/object.ts +25 -0
  199. package/src/{promise-middleware.js → promise-middleware.ts} +3 -3
  200. package/src/redux-store/{index.js → index.ts} +218 -131
  201. package/src/redux-store/metadata/{selectors.js → selectors.ts} +83 -54
  202. package/src/redux-store/metadata/types.ts +100 -0
  203. package/src/{registry.js → registry.ts} +98 -88
  204. package/src/{resolvers-cache-middleware.js → resolvers-cache-middleware.ts} +22 -7
  205. package/src/select.ts +6 -1
  206. package/src/store/{index.js → index.ts} +13 -8
  207. package/src/types.ts +263 -24
  208. package/src/plugins/persistence/storage/object.js +0 -23
  209. /package/src/components/async-mode-provider/{index.js → index.ts} +0 -0
  210. /package/src/components/registry-provider/{context.js → context.ts} +0 -0
  211. /package/src/components/registry-provider/{index.js → index.ts} +0 -0
  212. /package/src/components/use-dispatch/{index.js → index.ts} +0 -0
  213. /package/src/plugins/{index.js → index.ts} +0 -0
@@ -1,4 +1,5 @@
1
- export const Context: import("react").Context<import("../../registry").WPDataRegistry>;
1
+ export declare const Context: import("react").Context<import("../..").DataRegistry>;
2
+ declare const Provider: import("react").Provider<import("../..").DataRegistry>;
2
3
  /**
3
4
  * A custom react Context consumer exposing the provided `registry` to
4
5
  * children components. Used along with the RegistryProvider.
@@ -30,7 +31,13 @@ export const Context: import("react").Context<import("../../registry").WPDataReg
30
31
  * }
31
32
  * ```
32
33
  */
33
- export const RegistryConsumer: import("react").Consumer<import("../../registry").WPDataRegistry>;
34
+ export declare const RegistryConsumer: import("react").Consumer<import("../..").DataRegistry>;
35
+ /**
36
+ * A custom Context provider for exposing the provided `registry` to children
37
+ * components via a consumer.
38
+ *
39
+ * See <a name="#RegistryConsumer">RegistryConsumer</a> documentation for
40
+ * example.
41
+ */
34
42
  export default Provider;
35
- declare const Provider: import("react").Provider<import("../../registry").WPDataRegistry>;
36
43
  //# sourceMappingURL=context.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/components/registry-provider/context.js"],"names":[],"mappings":"AAUA,uFAAwD;AAKxD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,iGAAyC"}
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/components/registry-provider/context.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,OAAO,uDAAmC,CAAC;AAGxD,QAAA,MAAkB,QAAQ,wDAAY,CAAC;AAEvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,eAAO,MAAM,gBAAgB,wDAAW,CAAC;AAEzC;;;;;;GAMG;AACH,eAAe,QAAQ,CAAC"}
@@ -1,3 +1,3 @@
1
- export { default as useRegistry } from "./use-registry";
2
- export { default as RegistryProvider, RegistryConsumer } from "./context";
1
+ export { default as RegistryProvider, RegistryConsumer } from './context';
2
+ export { default as useRegistry } from './use-registry';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/registry-provider/index.js"],"names":[],"mappings":""}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/registry-provider/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC1E,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,gBAAgB,CAAC"}
@@ -1,3 +1,4 @@
1
+ import type { DataRegistry } from '../../types';
1
2
  /**
2
3
  * A custom react hook exposing the registry context for use.
3
4
  *
@@ -35,7 +36,7 @@
35
36
  * };
36
37
  * ```
37
38
  *
38
- * @return {import('../../types').DataRegistry} A custom react hook exposing the registry context value.
39
+ * @return A custom react hook exposing the registry context value.
39
40
  */
40
- export default function useRegistry(): import("../../types").DataRegistry;
41
+ export default function useRegistry(): DataRegistry;
41
42
  //# sourceMappingURL=use-registry.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-registry.d.ts","sourceRoot":"","sources":["../../../src/components/registry-provider/use-registry.js"],"names":[],"mappings":"AAUA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,uCAFY,OAAO,aAAa,EAAE,YAAY,CAI7C"}
1
+ {"version":3,"file":"use-registry.d.ts","sourceRoot":"","sources":["../../../src/components/registry-provider/use-registry.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,MAAM,CAAC,OAAO,UAAU,WAAW,IAAI,YAAY,CAElD"}
@@ -1,3 +1,3 @@
1
- export { default as useDispatch } from "./use-dispatch";
2
- export { default as useDispatchWithMap } from "./use-dispatch-with-map";
1
+ export { default as useDispatch } from './use-dispatch';
2
+ export { default as useDispatchWithMap } from './use-dispatch-with-map';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/use-dispatch/index.js"],"names":[],"mappings":""}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/use-dispatch/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,yBAAyB,CAAC"}
@@ -1,17 +1,19 @@
1
- export default useDispatchWithMap;
1
+ import type { DataRegistry } from '../../types';
2
+ type DispatchMap = (dispatch: DataRegistry['dispatch'], registry: DataRegistry) => Record<string, (...args: unknown[]) => unknown>;
2
3
  /**
3
4
  * Custom react hook for returning aggregate dispatch actions using the provided
4
5
  * dispatchMap.
5
6
  *
6
7
  * Currently this is an internal api only and is implemented by `withDispatch`
7
8
  *
8
- * @param {Function} dispatchMap Receives the `registry.dispatch` function as
9
- * the first argument and the `registry` object
10
- * as the second argument. Should return an
11
- * object mapping props to functions.
12
- * @param {Array} deps An array of dependencies for the hook.
13
- * @return {Object} An object mapping props to functions created by the passed
14
- * in dispatchMap.
9
+ * @param dispatchMap Receives the `registry.dispatch` function as
10
+ * the first argument and the `registry` object
11
+ * as the second argument. Should return an
12
+ * object mapping props to functions.
13
+ * @param deps An array of dependencies for the hook.
14
+ * @return An object mapping props to functions created by the passed
15
+ * in dispatchMap.
15
16
  */
16
- declare function useDispatchWithMap(dispatchMap: Function, deps: any[]): Object;
17
+ declare const useDispatchWithMap: (dispatchMap: DispatchMap, deps: unknown[]) => Record<string, (...args: unknown[]) => unknown>;
18
+ export default useDispatchWithMap;
17
19
  //# sourceMappingURL=use-dispatch-with-map.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-dispatch-with-map.d.ts","sourceRoot":"","sources":["../../../src/components/use-dispatch/use-dispatch-with-map.js"],"names":[],"mappings":";AAWA;;;;;;;;;;;;;GAaG;AACH,yEAHY,MAAM,CAoCjB"}
1
+ {"version":3,"file":"use-dispatch-with-map.d.ts","sourceRoot":"","sources":["../../../src/components/use-dispatch/use-dispatch-with-map.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,KAAK,WAAW,GAAG,CAClB,QAAQ,EAAE,YAAY,CAAE,UAAU,CAAE,EACpC,QAAQ,EAAE,YAAY,KAClB,MAAM,CAAE,MAAM,EAAE,CAAE,GAAG,IAAI,EAAE,OAAO,EAAE,KAAM,OAAO,CAAE,CAAC;AAEzD;;;;;;;;;;;;;GAaG;AACH,QAAA,MAAM,kBAAkB,GACvB,aAAa,WAAW,EACxB,MAAM,OAAO,EAAE,KACb,MAAM,CAAE,MAAM,EAAE,CAAE,GAAG,IAAI,EAAE,OAAO,EAAE,KAAM,OAAO,CAiCnD,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
@@ -1,26 +1,15 @@
1
- export default useDispatch;
2
- export type StoreDescriptor<StoreConfig extends import("../../types").AnyConfig> = import("../../types").StoreDescriptor<StoreConfig>;
3
- export type UseDispatchReturn<StoreNameOrDescriptor> = import("../../types").UseDispatchReturn<StoreNameOrDescriptor>;
4
- /**
5
- * @typedef {import('../../types').StoreDescriptor<StoreConfig>} StoreDescriptor
6
- * @template {import('../../types').AnyConfig} StoreConfig
7
- */
8
- /**
9
- * @typedef {import('../../types').UseDispatchReturn<StoreNameOrDescriptor>} UseDispatchReturn
10
- * @template StoreNameOrDescriptor
11
- */
1
+ import type { StoreDescriptor, AnyConfig, UseDispatchReturn } from '../../types';
12
2
  /**
13
3
  * A custom react hook returning the current registry dispatch actions creators.
14
4
  *
15
5
  * Note: The component using this hook must be within the context of a
16
6
  * RegistryProvider.
17
7
  *
18
- * @template {undefined | string | StoreDescriptor<any>} StoreNameOrDescriptor
19
- * @param {StoreNameOrDescriptor} [storeNameOrDescriptor] Optionally provide the name of the
20
- * store or its descriptor from which to
21
- * retrieve action creators. If not
22
- * provided, the registry.dispatch
23
- * function is returned instead.
8
+ * @param storeNameOrDescriptor Optionally provide the name of the
9
+ * store or its descriptor from which to
10
+ * retrieve action creators. If not
11
+ * provided, the registry.dispatch
12
+ * function is returned instead.
24
13
  *
25
14
  * @example
26
15
  * This illustrates a pattern where you may need to retrieve dynamic data from
@@ -53,7 +42,9 @@ export type UseDispatchReturn<StoreNameOrDescriptor> = import("../../types").Use
53
42
  * //
54
43
  * // <SaleButton>Start Sale!</SaleButton>
55
44
  * ```
56
- * @return {UseDispatchReturn<StoreNameOrDescriptor>} A custom react hook.
45
+ *
46
+ * @return The dispatch function or action creators for the store.
57
47
  */
58
- declare function useDispatch<StoreNameOrDescriptor extends undefined | string | StoreDescriptor<any>>(storeNameOrDescriptor?: StoreNameOrDescriptor): UseDispatchReturn<StoreNameOrDescriptor>;
48
+ declare const useDispatch: <StoreNameOrDescriptor extends undefined | string | StoreDescriptor<AnyConfig> = undefined>(storeNameOrDescriptor?: StoreNameOrDescriptor) => UseDispatchReturn<StoreNameOrDescriptor>;
49
+ export default useDispatch;
59
50
  //# sourceMappingURL=use-dispatch.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-dispatch.d.ts","sourceRoot":"","sources":["../../../src/components/use-dispatch/use-dispatch.js"],"names":[],"mappings":";4BAO+C,WAAW,SAA7C,OAAQ,aAAa,EAAE,SAAU,IADjC,OAAO,aAAa,EAAE,eAAe,CAAC,WAAW,CAAC;8BAKlD,qBAAqB,IADrB,OAAO,aAAa,EAAE,iBAAiB,CAAC,qBAAqB,CAAC;AAL3E;;;GAGG;AACH;;;GAGG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,6BAxCyD,qBAAqB,SAAhE,SAAS,GAAG,MAAM,GAAG,eAAe,CAAC,GAAG,CAAE,0BAC7C,qBAAqB,GAqCpB,iBAAiB,CAAC,qBAAqB,CAAC,CAOnD"}
1
+ {"version":3,"file":"use-dispatch.d.ts","sourceRoot":"","sources":["../../../src/components/use-dispatch/use-dispatch.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACX,eAAe,EACf,SAAS,EACT,iBAAiB,EACjB,MAAM,aAAa,CAAC;AAErB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,QAAA,MAAM,WAAW,GAChB,qBAAqB,SAClB,SAAS,GACT,MAAM,GACN,eAAe,CAAE,SAAS,CAAE,GAAG,SAAS,EAE3C,wBAAwB,qBAAqB,KAC3C,iBAAiB,CAAE,qBAAqB,CAO1C,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -1,19 +1,19 @@
1
+ import type { MapSelect, StoreDescriptor, AnyConfig, UseSelectReturn } from '../../types';
1
2
  /**
2
3
  * Custom react hook for retrieving props from registered selectors.
3
4
  *
4
5
  * In general, this custom React hook follows the
5
6
  * [rules of hooks](https://react.dev/reference/rules/rules-of-hooks).
6
7
  *
7
- * @template {MapSelect | StoreDescriptor<any>} T
8
- * @param {T} mapSelect Function called on every state change. The returned value is
9
- * exposed to the component implementing this hook. The function
10
- * receives the `registry.select` method on the first argument
11
- * and the `registry` on the second argument.
12
- * When a store key is passed, all selectors for the store will be
13
- * returned. This is only meant for usage of these selectors in event
14
- * callbacks, not for data needed to create the element tree.
15
- * @param {unknown[]=} deps If provided, this memoizes the mapSelect so the same `mapSelect` is
16
- * invoked on every state change unless the dependencies change.
8
+ * @param mapSelect Function called on every state change. The returned value is
9
+ * exposed to the component implementing this hook. The function
10
+ * receives the `registry.select` method on the first argument
11
+ * and the `registry` on the second argument.
12
+ * When a store key is passed, all selectors for the store will be
13
+ * returned. This is only meant for usage of these selectors in event
14
+ * callbacks, not for data needed to create the element tree.
15
+ * @param deps If provided, this memoizes the mapSelect so the same `mapSelect` is
16
+ * invoked on every state change unless the dependencies change.
17
17
  *
18
18
  * @example
19
19
  * ```js
@@ -60,31 +60,27 @@
60
60
  * return <div onPaste={ onPaste }>{ children }</div>;
61
61
  * }
62
62
  * ```
63
- * @return {UseSelectReturn<T>} A custom react hook.
63
+ *
64
+ * @return The selected data or store selectors.
64
65
  */
65
- export default function useSelect<T extends MapSelect | StoreDescriptor<any>>(mapSelect: T, deps?: unknown[] | undefined): UseSelectReturn<T>;
66
+ export default function useSelect<T extends MapSelect | StoreDescriptor<AnyConfig>>(mapSelect: T, deps?: unknown[]): UseSelectReturn<T>;
66
67
  /**
67
68
  * A variant of the `useSelect` hook that has the same API, but is a compatible
68
69
  * Suspense-enabled data source.
69
70
  *
70
- * @template {MapSelect} T
71
- * @param {T} mapSelect Function called on every state change. The
72
- * returned value is exposed to the component
73
- * using this hook. The function receives the
74
- * `registry.suspendSelect` method as the first
75
- * argument and the `registry` as the second one.
76
- * @param {Array} deps A dependency array used to memoize the `mapSelect`
77
- * so that the same `mapSelect` is invoked on every
78
- * state change unless the dependencies change.
71
+ * @param mapSelect Function called on every state change. The
72
+ * returned value is exposed to the component
73
+ * using this hook. The function receives the
74
+ * `registry.suspendSelect` method as the first
75
+ * argument and the `registry` as the second one.
76
+ * @param deps A dependency array used to memoize the `mapSelect`
77
+ * so that the same `mapSelect` is invoked on every
78
+ * state change unless the dependencies change.
79
79
  *
80
- * @throws {Promise} A suspense Promise that is thrown if any of the called
80
+ * @throws A suspense Promise that is thrown if any of the called
81
81
  * selectors is in an unresolved state.
82
82
  *
83
- * @return {ReturnType<T>} Data object returned by the `mapSelect` function.
83
+ * @return Data object returned by the `mapSelect` function.
84
84
  */
85
- export function useSuspenseSelect<T extends MapSelect>(mapSelect: T, deps: any[]): ReturnType<T>;
86
- export type StoreDescriptor<C extends import("../../types").AnyConfig> = import("../../types").StoreDescriptor<C>;
87
- export type ReduxStoreConfig<State, Actions extends Record<string, import("../../types").ActionCreator>, Selectors> = import("../../types").ReduxStoreConfig<State, Actions, Selectors>;
88
- export type MapSelect = import("../../types").MapSelect;
89
- export type UseSelectReturn<T extends MapSelect | StoreDescriptor<any>> = import("../../types").UseSelectReturn<T>;
85
+ export declare function useSuspenseSelect<T extends MapSelect>(mapSelect: T, deps: unknown[]): ReturnType<T>;
90
86
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/use-select/index.js"],"names":[],"mappings":"AAwPA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+DG;AACH,kCA1DgD,CAAC,SAAnC,SAAS,GAAG,eAAe,CAAC,GAAG,CAAE,aACpC,CAAC,SAOD,OAAO,EAAE,YAAC,GAgDT,eAAe,CAAC,CAAC,CAAC,CAqB7B;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,kCAfyB,CAAC,SAAZ,SAAU,aACb,CAAC,gBAYA,UAAU,CAAC,CAAC,CAAC,CAIxB;4BAxT8C,CAAC,SAAnC,OAAQ,aAAa,EAAE,SAAU,IADjC,OAAO,aAAa,EAAE,eAAe,CAAC,CAAC,CAAC;6BAKxC,KAAK,EACgD,OAAO,SAA3D,MAAM,CAAC,MAAM,EAAC,OAAO,aAAa,EAAE,aAAa,CAAE,EACpD,SAAS,IAHT,OAAO,aAAa,EAAE,gBAAgB,CAAC,KAAK,EAAC,OAAO,EAAC,SAAS,CAAC;wBAK9D,OAAO,aAAa,EAAE,SAAS;4BAGC,CAAC,SAAjC,SAAS,GAAC,eAAe,CAAC,GAAG,CAAE,IADhC,OAAO,aAAa,EAAE,eAAe,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/use-select/index.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EACX,SAAS,EAET,eAAe,EACf,SAAS,EACT,eAAe,EAEf,MAAM,aAAa,CAAC;AAsOrB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+DG;AACH,MAAM,CAAC,OAAO,UAAU,SAAS,CAChC,CAAC,SAAS,SAAS,GAAG,eAAe,CAAE,SAAS,CAAE,EAChD,SAAS,EAAE,CAAC,EAAE,IAAI,CAAC,EAAE,OAAO,EAAE,GAAI,eAAe,CAAE,CAAC,CAAE,CAsBxD;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,iBAAiB,CAAE,CAAC,SAAS,SAAS,EACrD,SAAS,EAAE,CAAC,EACZ,IAAI,EAAE,OAAO,EAAE,GACb,UAAU,CAAE,CAAC,CAAE,CAEjB"}
@@ -1,16 +1,14 @@
1
- export default withDispatch;
2
- export type ComponentType = React.ComponentType;
3
- /** @typedef {React.ComponentType} ComponentType */
1
+ import type { DataRegistry } from '../../types';
4
2
  /**
5
3
  * Higher-order component used to add dispatch props using registered action
6
4
  * creators.
7
5
  *
8
- * @param {Function} mapDispatchToProps A function of returning an object of
9
- * prop names where value is a
10
- * dispatch-bound action creator, or a
11
- * function to be called with the
12
- * component's props and returning an
13
- * action creator.
6
+ * @param mapDispatchToProps A function of returning an object of
7
+ * prop names where value is a
8
+ * dispatch-bound action creator, or a
9
+ * function to be called with the
10
+ * component's props and returning an
11
+ * action creator.
14
12
  *
15
13
  * @example
16
14
  * ```jsx
@@ -80,7 +78,8 @@ export type ComponentType = React.ComponentType;
80
78
  * returns an object with the same keys. For example, it should not contain
81
79
  * conditions under which a different value would be returned.
82
80
  *
83
- * @return {ComponentType} Enhanced component with merged dispatcher props.
81
+ * @return Enhanced component with merged dispatcher props.
84
82
  */
85
- declare function withDispatch(mapDispatchToProps: Function): ComponentType;
83
+ declare const withDispatch: (mapDispatchToProps: (dispatch: DataRegistry["dispatch"], ownProps: Record<string, unknown>, registry: DataRegistry) => Record<string, (...args: unknown[]) => unknown>) => (Inner: import("react").ComponentType<any>) => (ownProps: Record<string, unknown>) => import("react").JSX.Element;
84
+ export default withDispatch;
86
85
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/with-dispatch/index.js"],"names":[],"mappings":";4BAUc,KAAK,CAAC,aAAa;AAAjC,mDAAmD;AAEnD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgFG;AACH,6DAFY,aAAa,CAWvB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/with-dispatch/index.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgFG;AACH,QAAA,MAAM,YAAY,GACjB,oBAAoB,CACnB,QAAQ,EAAE,YAAY,CAAE,UAAU,CAAE,EACpC,QAAQ,EAAE,MAAM,CAAE,MAAM,EAAE,OAAO,CAAE,EACnC,QAAQ,EAAE,YAAY,KAClB,MAAM,CAAE,MAAM,EAAE,CAAE,GAAG,IAAI,EAAE,OAAO,EAAE,KAAM,OAAO,CAAE,+DAGnB,MAAM,CAAE,MAAM,EAAE,OAAO,CAAE,gCAS7D,CAAC;AAEH,eAAe,YAAY,CAAC"}
@@ -1,11 +1,7 @@
1
- export default withRegistry;
2
1
  /**
3
2
  * Higher-order component which renders the original component with the current
4
3
  * registry context passed as its `registry` prop.
5
- *
6
- * @param {Component} OriginalComponent Original component.
7
- *
8
- * @return {Component} Enhanced component.
9
4
  */
10
- declare const withRegistry: (Inner: import("react").ComponentType<any>) => (props: any) => import("react").JSX.Element;
5
+ declare const withRegistry: (Inner: import("react").ComponentType<any>) => (props: Record<string, unknown>) => import("react").JSX.Element;
6
+ export default withRegistry;
11
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/with-registry/index.js"],"names":[],"mappings":";AAUA;;;;;;;GAOG;AACH,uHASE"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/with-registry/index.tsx"],"names":[],"mappings":"AAUA;;;GAGG;AACH,QAAA,MAAM,YAAY,yDACiB,MAAM,CAAE,MAAM,EAAE,OAAO,CAAE,gCAQ3D,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -1,13 +1,11 @@
1
- export default withSelect;
2
- export type ComponentType = React.ComponentType;
3
- /** @typedef {React.ComponentType} ComponentType */
1
+ import type { SelectFunction, DataRegistry } from '../../types';
4
2
  /**
5
3
  * Higher-order component used to inject state-derived props using registered
6
4
  * selectors.
7
5
  *
8
- * @param {Function} mapSelectToProps Function called on every state change,
9
- * expected to return object of props to
10
- * merge with the component's own props.
6
+ * @param mapSelectToProps Function called on every state change,
7
+ * expected to return object of props to
8
+ * merge with the component's own props.
11
9
  *
12
10
  * @example
13
11
  * ```js
@@ -39,7 +37,8 @@ export type ComponentType = React.ComponentType;
39
37
  * component and update automatically if the price of a hammer ever changes in
40
38
  * the store.
41
39
  *
42
- * @return {ComponentType} Enhanced component with merged state data props.
40
+ * @return Enhanced component with merged state data props.
43
41
  */
44
- declare function withSelect(mapSelectToProps: Function): ComponentType;
42
+ declare const withSelect: (mapSelectToProps: (select: SelectFunction, ownProps: Record<string, unknown>, registry: DataRegistry) => Record<string, unknown>) => (Inner: import("react").ComponentType<any>) => import("react").ComponentType<Record<string, unknown>>;
43
+ export default withSelect;
45
44
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/with-select/index.js"],"names":[],"mappings":";4BAUc,KAAK,CAAC,aAAa;AAAjC,mDAAmD;AAEnD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,yDAFY,aAAa,CAYvB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/with-select/index.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,QAAA,MAAM,UAAU,GACf,kBAAkB,CACjB,MAAM,EAAE,cAAc,EACtB,QAAQ,EAAE,MAAM,CAAE,MAAM,EAAE,OAAO,CAAE,EACnC,QAAQ,EAAE,YAAY,KAClB,MAAM,CAAE,MAAM,EAAE,OAAO,CAAE,0GAa7B,CAAC;AAEH,eAAe,UAAU,CAAC"}
@@ -1,41 +1,13 @@
1
- export namespace controls {
2
- export { select };
3
- export { resolveSelect };
4
- export { dispatch };
5
- }
6
- export const builtinControls: {
7
- "@@data/SELECT": ((registry: any) => ({ storeKey, selectorName, args }: {
8
- storeKey: any;
9
- selectorName: any;
10
- args: any;
11
- }) => any) & {
12
- isRegistryControl?: boolean;
13
- };
14
- "@@data/RESOLVE_SELECT": ((registry: any) => ({ storeKey, selectorName, args }: {
15
- storeKey: any;
16
- selectorName: any;
17
- args: any;
18
- }) => any) & {
19
- isRegistryControl?: boolean;
20
- };
21
- "@@data/DISPATCH": ((registry: any) => ({ storeKey, actionName, args }: {
22
- storeKey: any;
23
- actionName: any;
24
- args: any;
25
- }) => any) & {
26
- isRegistryControl?: boolean;
27
- };
28
- };
29
- export type StoreDescriptor = import("./types").StoreDescriptor;
1
+ import type { StoreDescriptor } from './types';
30
2
  /**
31
3
  * Dispatches a control action for triggering a synchronous registry select.
32
4
  *
33
5
  * Note: This control synchronously returns the current selector value, triggering the
34
6
  * resolution, but not waiting for it.
35
7
  *
36
- * @param {string|StoreDescriptor} storeNameOrDescriptor Unique namespace identifier for the store
37
- * @param {string} selectorName The name of the selector.
38
- * @param {Array} args Arguments for the selector.
8
+ * @param storeNameOrDescriptor Unique namespace identifier for the store
9
+ * @param selectorName The name of the selector.
10
+ * @param args Arguments for the selector.
39
11
  *
40
12
  * @example
41
13
  * ```js
@@ -48,9 +20,14 @@ export type StoreDescriptor = import("./types").StoreDescriptor;
48
20
  * }
49
21
  * ```
50
22
  *
51
- * @return {Object} The control descriptor.
23
+ * @return The control descriptor.
52
24
  */
53
- declare function select(storeNameOrDescriptor: string | StoreDescriptor, selectorName: string, ...args: any[]): Object;
25
+ declare function select(storeNameOrDescriptor: string | StoreDescriptor, selectorName: string, ...args: unknown[]): {
26
+ type: string;
27
+ storeKey: string;
28
+ selectorName: string;
29
+ args: unknown[];
30
+ };
54
31
  /**
55
32
  * Dispatches a control action for triggering and resolving a registry select.
56
33
  *
@@ -58,9 +35,9 @@ declare function select(storeNameOrDescriptor: string | StoreDescriptor, selecto
58
35
  * selectors that may have a resolver. In such case, it will return a `Promise` that resolves
59
36
  * after the selector finishes resolving, with the final result value.
60
37
  *
61
- * @param {string|StoreDescriptor} storeNameOrDescriptor Unique namespace identifier for the store
62
- * @param {string} selectorName The name of the selector
63
- * @param {Array} args Arguments for the selector.
38
+ * @param storeNameOrDescriptor Unique namespace identifier for the store
39
+ * @param selectorName The name of the selector
40
+ * @param args Arguments for the selector.
64
41
  *
65
42
  * @example
66
43
  * ```js
@@ -73,15 +50,20 @@ declare function select(storeNameOrDescriptor: string | StoreDescriptor, selecto
73
50
  * }
74
51
  * ```
75
52
  *
76
- * @return {Object} The control descriptor.
53
+ * @return The control descriptor.
77
54
  */
78
- declare function resolveSelect(storeNameOrDescriptor: string | StoreDescriptor, selectorName: string, ...args: any[]): Object;
55
+ declare function resolveSelect(storeNameOrDescriptor: string | StoreDescriptor<any>, selectorName: string, ...args: any[]): {
56
+ type: string;
57
+ storeKey: string;
58
+ selectorName: string;
59
+ args: any[];
60
+ };
79
61
  /**
80
62
  * Dispatches a control action for triggering a registry dispatch.
81
63
  *
82
- * @param {string|StoreDescriptor} storeNameOrDescriptor Unique namespace identifier for the store
83
- * @param {string} actionName The name of the action to dispatch
84
- * @param {Array} args Arguments for the dispatch action.
64
+ * @param storeNameOrDescriptor Unique namespace identifier for the store
65
+ * @param actionName The name of the action to dispatch
66
+ * @param args Arguments for the dispatch action.
85
67
  *
86
68
  * @example
87
69
  * ```js
@@ -94,8 +76,39 @@ declare function resolveSelect(storeNameOrDescriptor: string | StoreDescriptor,
94
76
  * }
95
77
  * ```
96
78
  *
97
- * @return {Object} The control descriptor.
79
+ * @return The control descriptor.
98
80
  */
99
- declare function dispatch(storeNameOrDescriptor: string | StoreDescriptor, actionName: string, ...args: any[]): Object;
81
+ declare function dispatch(storeNameOrDescriptor: string | StoreDescriptor, actionName: string, ...args: unknown[]): {
82
+ type: string;
83
+ storeKey: string;
84
+ actionName: string;
85
+ args: unknown[];
86
+ };
87
+ export declare const controls: {
88
+ select: typeof select;
89
+ resolveSelect: typeof resolveSelect;
90
+ dispatch: typeof dispatch;
91
+ };
92
+ type SelectorControlArgs = {
93
+ storeKey: string;
94
+ selectorName: string;
95
+ args: unknown[];
96
+ };
97
+ type ActionControlArgs = {
98
+ storeKey: string;
99
+ actionName: string;
100
+ args: unknown[];
101
+ };
102
+ export declare const builtinControls: {
103
+ "@@data/SELECT": ((registry: import("./types").DataRegistry) => ({ storeKey, selectorName, args }: SelectorControlArgs) => any) & {
104
+ isRegistryControl?: boolean;
105
+ };
106
+ "@@data/RESOLVE_SELECT": ((registry: import("./types").DataRegistry) => ({ storeKey, selectorName, args }: SelectorControlArgs) => any) & {
107
+ isRegistryControl?: boolean;
108
+ };
109
+ "@@data/DISPATCH": ((registry: import("./types").DataRegistry) => ({ storeKey, actionName, args }: ActionControlArgs) => any) & {
110
+ isRegistryControl?: boolean;
111
+ };
112
+ };
100
113
  export {};
101
114
  //# sourceMappingURL=controls.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"controls.d.ts","sourceRoot":"","sources":["../src/controls.js"],"names":[],"mappings":";;;;;AAqHA;;;;;;;;;;;;;;;;;;;;;;EAuBE;8BAvIY,OAAO,SAAS,EAAE,eAAe;AAU/C;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,+CAjBW,MAAM,GAAC,eAAe,gBACtB,MAAM,mBAcL,MAAM,CAWjB;AAED;;;;;;;;;;;;;;;;;;;;;;;G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+1,3 @@
1
- declare const _default: import("./registry").WPDataRegistry;
2
- export default _default;
1
+ declare const defaultRegistry: import("./types").DataRegistry;
2
+ export default defaultRegistry;
3
3
  //# sourceMappingURL=default-registry.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"default-registry.d.ts","sourceRoot":"","sources":["../src/default-registry.js"],"names":[],"mappings":""}
1
+ {"version":3,"file":"default-registry.d.ts","sourceRoot":"","sources":["../src/default-registry.ts"],"names":[],"mappings":"AAKA,QAAA,MAAM,eAAe,gCAAmB,CAAC;AAEzC,eAAe,eAAe,CAAC"}
@@ -9,6 +9,10 @@ import type { AnyConfig, StoreDescriptor, DispatchReturn } from './types';
9
9
  * Note: Action creators returned by the dispatch will return a promise when
10
10
  * they are called.
11
11
  *
12
+ * Warning: This global `dispatch` function only works with the default registry.
13
+ * It will not work with custom `RegistryProvider` or `BlockEditorProvider` contexts.
14
+ * In React components, prefer the `useDispatch` hook instead, which is registry-aware.
15
+ *
12
16
  * @param storeNameOrDescriptor The store descriptor. The legacy calling convention of passing
13
17
  * the store name is also supported.
14
18
  *
@@ -1 +1 @@
1
- {"version":3,"file":"dispatch.d.ts","sourceRoot":"","sources":["../src/dispatch.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAG1E;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,QAAQ,CACvB,qBAAqB,SAAS,eAAe,CAAE,SAAS,CAAE,GAAG,MAAM,EAEnE,qBAAqB,EAAE,qBAAqB,GAC1C,cAAc,CAAE,qBAAqB,CAAE,CAEzC"}
1
+ {"version":3,"file":"dispatch.d.ts","sourceRoot":"","sources":["../src/dispatch.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAG1E;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,QAAQ,CACvB,qBAAqB,SAAS,eAAe,CAAE,SAAS,CAAE,GAAG,MAAM,EAEnE,qBAAqB,EAAE,qBAAqB,GAC1C,cAAc,CAAE,qBAAqB,CAAE,CAIzC"}
@@ -2,6 +2,7 @@
2
2
  * Internal dependencies
3
3
  */
4
4
  import type { select as globalSelect } from './select';
5
+ import type { DataRegistry } from './types';
5
6
  type RegistrySelector<Selector extends (...args: any[]) => any> = {
6
7
  (...args: Parameters<Selector>): ReturnType<Selector>;
7
8
  isRegistrySelector?: boolean;
@@ -68,7 +69,7 @@ export declare function createRegistrySelector<Selector extends (...args: any[])
68
69
  *
69
70
  * @return Registry control that can be registered with a store.
70
71
  */
71
- export declare function createRegistryControl<T extends (...args: any) => any>(registryControl: T & {
72
+ export declare function createRegistryControl<T extends (registry: DataRegistry) => (...args: any) => any>(registryControl: T & {
72
73
  isRegistryControl?: boolean;
73
74
  }): T & {
74
75
  isRegistryControl?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../src/factory.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,UAAU,CAAC;AAEvD,KAAK,gBAAgB,CAAE,QAAQ,SAAS,CAAE,GAAG,IAAI,EAAE,GAAG,EAAE,KAAM,GAAG,IAAK;IACrE,CAAE,GAAG,IAAI,EAAE,UAAU,CAAE,QAAQ,CAAE,GAAI,UAAU,CAAE,QAAQ,CAAE,CAAC;IAC5D,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,EAAE,GAAG,CAAC;CACf,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,wBAAgB,sBAAsB,CACrC,QAAQ,SAAS,CAAE,GAAG,IAAI,EAAE,GAAG,EAAE,KAAM,GAAG,EAE1C,gBAAgB,EAAE,CAAE,MAAM,EAAE,OAA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A6D,CAAC;AAEjE;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,SAAS,GACrB,UAAU,MAAM,IAAI,EACpB,wBACG,MAAM,GACN,eAAe,CAAE,gBAAgB,CAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAE,CAAE,KACrD,CAAE,MAAM,IAAI,CAC8C,CAAC;AAE9D;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB,EAAE,QACE,CAAC;AAEtC;;;;;;;;;GASG;AACH,eAAO,MAAM,aAAa,EAAE,QAAwC,CAAC;AAErE;;;;;;GAMG;AACH,eAAO,MAAM,GAAG,EAAE,GAAyB,CAAC;AAE5C;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,QAAQ,GACpB,OAAO,eAAe,CAAE,gBAAgB,CAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAE,CAAE,KACzD,IAAyC,CAAC"}
@@ -1,2 +1,2 @@
1
- export { default as persistence } from "./persistence";
1
+ export { default as persistence } from './persistence';
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugins/index.js"],"names":[],"mappings":""}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugins/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC"}