@latticexyz/react 2.0.0-main-1f3897bd → 2.0.0-main-59054203

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.
package/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Change Log
2
2
 
3
- ## 2.0.0-main-1f3897bd
3
+ ## 2.0.0-main-59054203
4
4
 
5
5
  ### Major Changes
6
6
 
@@ -29,6 +29,7 @@
29
29
 
30
30
  ### Patch Changes
31
31
 
32
+ - 59054203: TS packages now generate their respective `.d.ts` type definition files for better compatibility when using MUD with `moduleResolution` set to `bundler` or `node16` and fixes issues around missing type declarations for dependent packages.
32
33
  - 9ef3f9a7: Fixed an issue where `useComponentValue` would not detect a change and re-render if the component value was immediately removed.
33
34
  - Updated dependencies [7ce82b6f]
34
35
  - Updated dependencies [c963b46c]
@@ -69,6 +70,7 @@
69
70
  - Updated dependencies [1e2ad78e]
70
71
  - Updated dependencies [65c9546c]
71
72
  - Updated dependencies [48909d15]
73
+ - Updated dependencies [59054203]
72
74
  - Updated dependencies [48c51b52]
73
75
  - Updated dependencies [66cc35a8]
74
76
  - Updated dependencies [672d05ca]
@@ -101,8 +103,8 @@
101
103
  - Updated dependencies [afdba793]
102
104
  - Updated dependencies [cea754dd]
103
105
  - Updated dependencies [cc2c8da0]
104
- - @latticexyz/store@2.0.0-main-1f3897bd
105
- - @latticexyz/recs@2.0.0-main-1f3897bd
106
+ - @latticexyz/store@2.0.0-main-59054203
107
+ - @latticexyz/recs@2.0.0-main-59054203
106
108
 
107
109
  ## 2.0.0-next.14
108
110
 
@@ -0,0 +1,36 @@
1
+ import * as _latticexyz_recs from '@latticexyz/recs';
2
+ import { Schema, Component, Entity, ComponentValue, QueryFragment } from '@latticexyz/recs';
3
+ import { IComputedValue } from 'mobx';
4
+ import { Observable } from 'rxjs';
5
+
6
+ declare function useComponentValue<S extends Schema>(component: Component<S>, entity: Entity | undefined, defaultValue: ComponentValue<S>): ComponentValue<S>;
7
+ declare function useComponentValue<S extends Schema>(component: Component<S>, entity: Entity | undefined): ComponentValue<S> | undefined;
8
+
9
+ /** @deprecated See https://github.com/latticexyz/mud/issues/339 */
10
+ declare const useDeprecatedComputedValue: <T>(computedValue: IComputedValue<T> & {
11
+ observe_: any;
12
+ }) => T;
13
+
14
+ /**
15
+ * Returns all matching entities for a given entity query,
16
+ * and triggers a re-render as new query results come in.
17
+ *
18
+ * @param fragments Query fragments to match against, executed from left to right.
19
+ * @param options.updateOnValueChange False - re-renders only on entity array changes. True (default) - also on component value changes.
20
+ * @returns Set of entities matching the query fragments.
21
+ */
22
+ declare function useEntityQuery(fragments: QueryFragment[], options?: {
23
+ updateOnValueChange?: boolean;
24
+ }): _latticexyz_recs.Entity[];
25
+
26
+ declare function useObservableValue<T>(observable: Observable<T>, defaultValue: T): T;
27
+ declare function useObservableValue<T>(observable: Observable<T>): T | undefined;
28
+
29
+ type UsePromiseResult<T> = PromiseSettledResult<Awaited<T>> | {
30
+ status: "pending";
31
+ } | {
32
+ status: "idle";
33
+ };
34
+ declare function usePromise<T>(promise: PromiseLike<T> | null | undefined): UsePromiseResult<T>;
35
+
36
+ export { UsePromiseResult, useComponentValue, useDeprecatedComputedValue, useEntityQuery, useObservableValue, usePromise };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@latticexyz/react",
3
- "version": "2.0.0-main-1f3897bd",
3
+ "version": "2.0.0-main-59054203",
4
4
  "description": "React tools for MUD client.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -18,8 +18,8 @@
18
18
  "mobx": "^6.7.0",
19
19
  "react": "^18.2.0",
20
20
  "rxjs": "7.5.5",
21
- "@latticexyz/recs": "2.0.0-main-1f3897bd",
22
- "@latticexyz/store": "2.0.0-main-1f3897bd"
21
+ "@latticexyz/recs": "2.0.0-main-59054203",
22
+ "@latticexyz/store": "2.0.0-main-59054203"
23
23
  },
24
24
  "devDependencies": {
25
25
  "@testing-library/react-hooks": "^8.0.1",