@wirestate/react 0.6.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 (202) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/LICENSE +21 -0
  3. package/README.md +319 -0
  4. package/cjs/development/index.js +395 -0
  5. package/cjs/development/index.js.map +1 -0
  6. package/cjs/development/lib.js +64 -0
  7. package/cjs/development/lib.js.map +1 -0
  8. package/cjs/development/test-utils.js +1075 -0
  9. package/cjs/development/test-utils.js.map +1 -0
  10. package/cjs/production/index.js +1 -0
  11. package/cjs/production/index.js.map +1 -0
  12. package/cjs/production/lib.js +1 -0
  13. package/cjs/production/lib.js.map +1 -0
  14. package/cjs/production/test-utils.js +1 -0
  15. package/cjs/production/test-utils.js.map +1 -0
  16. package/esm/development/wirestate-core/bind/bind-constant.js +19 -0
  17. package/esm/development/wirestate-core/bind/bind-constant.js.map +1 -0
  18. package/esm/development/wirestate-core/bind/bind-dynamic-value.js +28 -0
  19. package/esm/development/wirestate-core/bind/bind-dynamic-value.js.map +1 -0
  20. package/esm/development/wirestate-core/bind/bind-entry.js +39 -0
  21. package/esm/development/wirestate-core/bind/bind-entry.js.map +1 -0
  22. package/esm/development/wirestate-core/bind/bind-service.js +253 -0
  23. package/esm/development/wirestate-core/bind/bind-service.js.map +1 -0
  24. package/esm/development/wirestate-core/bind/get-entry-token.js +14 -0
  25. package/esm/development/wirestate-core/bind/get-entry-token.js.map +1 -0
  26. package/esm/development/wirestate-core/commands/command-bus.js +112 -0
  27. package/esm/development/wirestate-core/commands/command-bus.js.map +1 -0
  28. package/esm/development/wirestate-core/commands/get-command-handler-metadata.js +27 -0
  29. package/esm/development/wirestate-core/commands/get-command-handler-metadata.js.map +1 -0
  30. package/esm/development/wirestate-core/container/create-ioc-container.js +35 -0
  31. package/esm/development/wirestate-core/container/create-ioc-container.js.map +1 -0
  32. package/esm/development/wirestate-core/container/wire-scope.js +151 -0
  33. package/esm/development/wirestate-core/container/wire-scope.js.map +1 -0
  34. package/esm/development/wirestate-core/error/error-code.js +10 -0
  35. package/esm/development/wirestate-core/error/error-code.js.map +1 -0
  36. package/esm/development/wirestate-core/error/wirestate-error.js +29 -0
  37. package/esm/development/wirestate-core/error/wirestate-error.js.map +1 -0
  38. package/esm/development/wirestate-core/events/build-event-dispatcher.js +39 -0
  39. package/esm/development/wirestate-core/events/build-event-dispatcher.js.map +1 -0
  40. package/esm/development/wirestate-core/events/event-bus.js +52 -0
  41. package/esm/development/wirestate-core/events/event-bus.js.map +1 -0
  42. package/esm/development/wirestate-core/events/get-event-handler-metadata.js +27 -0
  43. package/esm/development/wirestate-core/events/get-event-handler-metadata.js.map +1 -0
  44. package/esm/development/wirestate-core/queries/get-query-handler-metadata.js +27 -0
  45. package/esm/development/wirestate-core/queries/get-query-handler-metadata.js.map +1 -0
  46. package/esm/development/wirestate-core/queries/query-bus.js +99 -0
  47. package/esm/development/wirestate-core/queries/query-bus.js.map +1 -0
  48. package/esm/development/wirestate-core/registry.js +56 -0
  49. package/esm/development/wirestate-core/registry.js.map +1 -0
  50. package/esm/development/wirestate-core/service/get-activated-handler-metadata.js +27 -0
  51. package/esm/development/wirestate-core/service/get-activated-handler-metadata.js.map +1 -0
  52. package/esm/development/wirestate-core/service/get-deactivation-handler-metadata.js +27 -0
  53. package/esm/development/wirestate-core/service/get-deactivation-handler-metadata.js.map +1 -0
  54. package/esm/development/wirestate-core/test-utils/mock-bind-entry.js +24 -0
  55. package/esm/development/wirestate-core/test-utils/mock-bind-entry.js.map +1 -0
  56. package/esm/development/wirestate-core/test-utils/mock-container.js +52 -0
  57. package/esm/development/wirestate-core/test-utils/mock-container.js.map +1 -0
  58. package/esm/development/wirestate-core/types/commands.js +12 -0
  59. package/esm/development/wirestate-core/types/commands.js.map +1 -0
  60. package/esm/development/wirestate-react/commands/use-command-caller.js +18 -0
  61. package/esm/development/wirestate-react/commands/use-command-caller.js.map +1 -0
  62. package/esm/development/wirestate-react/commands/use-command-handler.js +28 -0
  63. package/esm/development/wirestate-react/commands/use-command-handler.js.map +1 -0
  64. package/esm/development/wirestate-react/commands/use-optional-command-caller.js +19 -0
  65. package/esm/development/wirestate-react/commands/use-optional-command-caller.js.map +1 -0
  66. package/esm/development/wirestate-react/error/error-code.js +6 -0
  67. package/esm/development/wirestate-react/error/error-code.js.map +1 -0
  68. package/esm/development/wirestate-react/events/use-event-emitter.js +22 -0
  69. package/esm/development/wirestate-react/events/use-event-emitter.js.map +1 -0
  70. package/esm/development/wirestate-react/events/use-event.js +30 -0
  71. package/esm/development/wirestate-react/events/use-event.js.map +1 -0
  72. package/esm/development/wirestate-react/events/use-events-handler.js +25 -0
  73. package/esm/development/wirestate-react/events/use-events-handler.js.map +1 -0
  74. package/esm/development/wirestate-react/events/use-events.js +31 -0
  75. package/esm/development/wirestate-react/events/use-events.js.map +1 -0
  76. package/esm/development/wirestate-react/index.js +19 -0
  77. package/esm/development/wirestate-react/index.js.map +1 -0
  78. package/esm/development/wirestate-react/provision/create-injectables-provider.js +101 -0
  79. package/esm/development/wirestate-react/provision/create-injectables-provider.js.map +1 -0
  80. package/esm/development/wirestate-react/provision/ioc-context.js +11 -0
  81. package/esm/development/wirestate-react/provision/ioc-context.js.map +1 -0
  82. package/esm/development/wirestate-react/provision/ioc-provider.js +50 -0
  83. package/esm/development/wirestate-react/provision/ioc-provider.js.map +1 -0
  84. package/esm/development/wirestate-react/provision/use-container-revision.js +13 -0
  85. package/esm/development/wirestate-react/provision/use-container-revision.js.map +1 -0
  86. package/esm/development/wirestate-react/provision/use-container.js +13 -0
  87. package/esm/development/wirestate-react/provision/use-container.js.map +1 -0
  88. package/esm/development/wirestate-react/provision/use-injection.js +22 -0
  89. package/esm/development/wirestate-react/provision/use-injection.js.map +1 -0
  90. package/esm/development/wirestate-react/provision/use-ioc-context.js +21 -0
  91. package/esm/development/wirestate-react/provision/use-ioc-context.js.map +1 -0
  92. package/esm/development/wirestate-react/provision/use-optional-injection.js +29 -0
  93. package/esm/development/wirestate-react/provision/use-optional-injection.js.map +1 -0
  94. package/esm/development/wirestate-react/queries/use-optional-query-caller.js +19 -0
  95. package/esm/development/wirestate-react/queries/use-optional-query-caller.js.map +1 -0
  96. package/esm/development/wirestate-react/queries/use-optional-sync-query-caller.js +19 -0
  97. package/esm/development/wirestate-react/queries/use-optional-sync-query-caller.js.map +1 -0
  98. package/esm/development/wirestate-react/queries/use-query-caller.js +18 -0
  99. package/esm/development/wirestate-react/queries/use-query-caller.js.map +1 -0
  100. package/esm/development/wirestate-react/queries/use-query-handler.js +27 -0
  101. package/esm/development/wirestate-react/queries/use-query-handler.js.map +1 -0
  102. package/esm/development/wirestate-react/queries/use-sync-query-caller.js +20 -0
  103. package/esm/development/wirestate-react/queries/use-sync-query-caller.js.map +1 -0
  104. package/esm/development/wirestate-react/test-utils/with-ioc-provider.js +30 -0
  105. package/esm/development/wirestate-react/test-utils/with-ioc-provider.js.map +1 -0
  106. package/esm/development/wirestate-react/test-utils.js +2 -0
  107. package/esm/development/wirestate-react/test-utils.js.map +1 -0
  108. package/esm/production/wirestate-core/bind/bind-constant.js +1 -0
  109. package/esm/production/wirestate-core/bind/bind-constant.js.map +1 -0
  110. package/esm/production/wirestate-core/bind/bind-dynamic-value.js +1 -0
  111. package/esm/production/wirestate-core/bind/bind-dynamic-value.js.map +1 -0
  112. package/esm/production/wirestate-core/bind/bind-entry.js +1 -0
  113. package/esm/production/wirestate-core/bind/bind-entry.js.map +1 -0
  114. package/esm/production/wirestate-core/bind/bind-service.js +1 -0
  115. package/esm/production/wirestate-core/bind/bind-service.js.map +1 -0
  116. package/esm/production/wirestate-core/bind/get-entry-token.js +1 -0
  117. package/esm/production/wirestate-core/bind/get-entry-token.js.map +1 -0
  118. package/esm/production/wirestate-core/commands/command-bus.js +1 -0
  119. package/esm/production/wirestate-core/commands/command-bus.js.map +1 -0
  120. package/esm/production/wirestate-core/commands/get-command-handler-metadata.js +1 -0
  121. package/esm/production/wirestate-core/commands/get-command-handler-metadata.js.map +1 -0
  122. package/esm/production/wirestate-core/container/create-ioc-container.js +1 -0
  123. package/esm/production/wirestate-core/container/create-ioc-container.js.map +1 -0
  124. package/esm/production/wirestate-core/container/wire-scope.js +1 -0
  125. package/esm/production/wirestate-core/container/wire-scope.js.map +1 -0
  126. package/esm/production/wirestate-core/error/error-code.js +1 -0
  127. package/esm/production/wirestate-core/error/error-code.js.map +1 -0
  128. package/esm/production/wirestate-core/error/wirestate-error.js +1 -0
  129. package/esm/production/wirestate-core/error/wirestate-error.js.map +1 -0
  130. package/esm/production/wirestate-core/events/build-event-dispatcher.js +1 -0
  131. package/esm/production/wirestate-core/events/build-event-dispatcher.js.map +1 -0
  132. package/esm/production/wirestate-core/events/event-bus.js +1 -0
  133. package/esm/production/wirestate-core/events/event-bus.js.map +1 -0
  134. package/esm/production/wirestate-core/events/get-event-handler-metadata.js +1 -0
  135. package/esm/production/wirestate-core/events/get-event-handler-metadata.js.map +1 -0
  136. package/esm/production/wirestate-core/queries/get-query-handler-metadata.js +1 -0
  137. package/esm/production/wirestate-core/queries/get-query-handler-metadata.js.map +1 -0
  138. package/esm/production/wirestate-core/queries/query-bus.js +1 -0
  139. package/esm/production/wirestate-core/queries/query-bus.js.map +1 -0
  140. package/esm/production/wirestate-core/registry.js +1 -0
  141. package/esm/production/wirestate-core/registry.js.map +1 -0
  142. package/esm/production/wirestate-core/service/get-activated-handler-metadata.js +1 -0
  143. package/esm/production/wirestate-core/service/get-activated-handler-metadata.js.map +1 -0
  144. package/esm/production/wirestate-core/service/get-deactivation-handler-metadata.js +1 -0
  145. package/esm/production/wirestate-core/service/get-deactivation-handler-metadata.js.map +1 -0
  146. package/esm/production/wirestate-core/test-utils/mock-bind-entry.js +1 -0
  147. package/esm/production/wirestate-core/test-utils/mock-bind-entry.js.map +1 -0
  148. package/esm/production/wirestate-core/test-utils/mock-container.js +1 -0
  149. package/esm/production/wirestate-core/test-utils/mock-container.js.map +1 -0
  150. package/esm/production/wirestate-core/types/commands.js +1 -0
  151. package/esm/production/wirestate-core/types/commands.js.map +1 -0
  152. package/esm/production/wirestate-react/commands/use-command-caller.js +1 -0
  153. package/esm/production/wirestate-react/commands/use-command-caller.js.map +1 -0
  154. package/esm/production/wirestate-react/commands/use-command-handler.js +1 -0
  155. package/esm/production/wirestate-react/commands/use-command-handler.js.map +1 -0
  156. package/esm/production/wirestate-react/commands/use-optional-command-caller.js +1 -0
  157. package/esm/production/wirestate-react/commands/use-optional-command-caller.js.map +1 -0
  158. package/esm/production/wirestate-react/error/error-code.js +1 -0
  159. package/esm/production/wirestate-react/error/error-code.js.map +1 -0
  160. package/esm/production/wirestate-react/events/use-event-emitter.js +1 -0
  161. package/esm/production/wirestate-react/events/use-event-emitter.js.map +1 -0
  162. package/esm/production/wirestate-react/events/use-event.js +1 -0
  163. package/esm/production/wirestate-react/events/use-event.js.map +1 -0
  164. package/esm/production/wirestate-react/events/use-events-handler.js +1 -0
  165. package/esm/production/wirestate-react/events/use-events-handler.js.map +1 -0
  166. package/esm/production/wirestate-react/events/use-events.js +1 -0
  167. package/esm/production/wirestate-react/events/use-events.js.map +1 -0
  168. package/esm/production/wirestate-react/index.js +1 -0
  169. package/esm/production/wirestate-react/index.js.map +1 -0
  170. package/esm/production/wirestate-react/provision/create-injectables-provider.js +1 -0
  171. package/esm/production/wirestate-react/provision/create-injectables-provider.js.map +1 -0
  172. package/esm/production/wirestate-react/provision/ioc-context.js +1 -0
  173. package/esm/production/wirestate-react/provision/ioc-context.js.map +1 -0
  174. package/esm/production/wirestate-react/provision/ioc-provider.js +1 -0
  175. package/esm/production/wirestate-react/provision/ioc-provider.js.map +1 -0
  176. package/esm/production/wirestate-react/provision/use-container-revision.js +1 -0
  177. package/esm/production/wirestate-react/provision/use-container-revision.js.map +1 -0
  178. package/esm/production/wirestate-react/provision/use-container.js +1 -0
  179. package/esm/production/wirestate-react/provision/use-container.js.map +1 -0
  180. package/esm/production/wirestate-react/provision/use-injection.js +1 -0
  181. package/esm/production/wirestate-react/provision/use-injection.js.map +1 -0
  182. package/esm/production/wirestate-react/provision/use-ioc-context.js +1 -0
  183. package/esm/production/wirestate-react/provision/use-ioc-context.js.map +1 -0
  184. package/esm/production/wirestate-react/provision/use-optional-injection.js +1 -0
  185. package/esm/production/wirestate-react/provision/use-optional-injection.js.map +1 -0
  186. package/esm/production/wirestate-react/queries/use-optional-query-caller.js +1 -0
  187. package/esm/production/wirestate-react/queries/use-optional-query-caller.js.map +1 -0
  188. package/esm/production/wirestate-react/queries/use-optional-sync-query-caller.js +1 -0
  189. package/esm/production/wirestate-react/queries/use-optional-sync-query-caller.js.map +1 -0
  190. package/esm/production/wirestate-react/queries/use-query-caller.js +1 -0
  191. package/esm/production/wirestate-react/queries/use-query-caller.js.map +1 -0
  192. package/esm/production/wirestate-react/queries/use-query-handler.js +1 -0
  193. package/esm/production/wirestate-react/queries/use-query-handler.js.map +1 -0
  194. package/esm/production/wirestate-react/queries/use-sync-query-caller.js +1 -0
  195. package/esm/production/wirestate-react/queries/use-sync-query-caller.js.map +1 -0
  196. package/esm/production/wirestate-react/test-utils/with-ioc-provider.js +1 -0
  197. package/esm/production/wirestate-react/test-utils/with-ioc-provider.js.map +1 -0
  198. package/esm/production/wirestate-react/test-utils.js +1 -0
  199. package/esm/production/wirestate-react/test-utils.js.map +1 -0
  200. package/index.d.ts +218 -0
  201. package/package.json +62 -0
  202. package/test-utils.d.ts +18 -0
@@ -0,0 +1,18 @@
1
+ import * as react from 'react';
2
+ import { ReactNode } from 'react';
3
+ import { Container } from '@wirestate/core';
4
+
5
+ /**
6
+ * Wraps a component with IocProvider for testing.
7
+ *
8
+ * @param children - components to wrap
9
+ * @param container - optional custom container
10
+ * @param seed - optional shared seed object
11
+ * @returns wrapped components
12
+ */
13
+ declare function withIocProvider(children: ReactNode, container?: Container, seed?: Record<string, unknown>): react.FunctionComponentElement<{
14
+ container: Container;
15
+ seed: Record<string, unknown> | undefined;
16
+ }>;
17
+
18
+ export { withIocProvider };