@logixjs/react 0.1.0 → 0.1.1

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/dist/index.d.cts CHANGED
@@ -1,10 +1,10 @@
1
1
  export { ModuleHandle, ModulePreloadPolicy, RuntimeProvider, RuntimeProviderErrorContext, RuntimeProviderPolicy, RuntimeProviderPolicyMode, RuntimeProviderProps, YieldPolicy, YieldStrategy } from './RuntimeProvider.cjs';
2
2
  export { UseProcessesOptions, UseRuntimeOptions, shallow, useImportedModule, useLayerModule, useModuleList, useProcesses, useRuntime } from './Hooks.cjs';
3
- export { c as useDispatch, a as useLocalModule, u as useModule, b as useSelector } from './useDispatch-CnO5-66H.cjs';
3
+ export { c as useDispatch, a as useLocalModule, u as useModule, b as useSelector } from './useDispatch-DiwQQAfC.cjs';
4
4
  export { ReactPlatformLayer } from './Platform.cjs';
5
5
  export { ReactPlatform } from './ReactPlatform.cjs';
6
6
  export { ModuleScope, ModuleScopeOptions } from './ModuleScope.cjs';
7
- export { M as ModuleActions, a as ModuleDispatchers, b as ModuleDispatchersOfShape, c as ModuleRef } from './ModuleRef-wZSQ3Wwo.cjs';
7
+ export { c as ModuleActionTagsOfShape, M as ModuleActions, a as ModuleDispatchers, b as ModuleDispatchersOfShape, d as ModuleRef, f as ModuleRefOfDef, g as ModuleRefOfModule, e as ModuleRefOfShape, h as ModuleRefOfTag } from './ModuleRef-gZmL6Zvb.cjs';
8
8
  import 'react';
9
9
  import 'effect';
10
10
  import '@logixjs/core';
package/dist/index.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  export { ModuleHandle, ModulePreloadPolicy, RuntimeProvider, RuntimeProviderErrorContext, RuntimeProviderPolicy, RuntimeProviderPolicyMode, RuntimeProviderProps, YieldPolicy, YieldStrategy } from './RuntimeProvider.js';
2
2
  export { UseProcessesOptions, UseRuntimeOptions, shallow, useImportedModule, useLayerModule, useModuleList, useProcesses, useRuntime } from './Hooks.js';
3
- export { c as useDispatch, a as useLocalModule, u as useModule, b as useSelector } from './useDispatch-BnzYVkRE.js';
3
+ export { c as useDispatch, a as useLocalModule, u as useModule, b as useSelector } from './useDispatch-CiDimIYZ.js';
4
4
  export { ReactPlatformLayer } from './Platform.js';
5
5
  export { ReactPlatform } from './ReactPlatform.js';
6
6
  export { ModuleScope, ModuleScopeOptions } from './ModuleScope.js';
7
- export { M as ModuleActions, a as ModuleDispatchers, b as ModuleDispatchersOfShape, c as ModuleRef } from './ModuleRef-wZSQ3Wwo.js';
7
+ export { c as ModuleActionTagsOfShape, M as ModuleActions, a as ModuleDispatchers, b as ModuleDispatchersOfShape, d as ModuleRef, f as ModuleRefOfDef, g as ModuleRefOfModule, e as ModuleRefOfShape, h as ModuleRefOfTag } from './ModuleRef-gZmL6Zvb.js';
8
8
  import 'react';
9
9
  import 'effect';
10
10
  import '@logixjs/core';
package/dist/index.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  ModuleScope
3
- } from "./chunk-G5MRIFKK.js";
3
+ } from "./chunk-STTE4SOJ.js";
4
4
  import {
5
5
  ReactPlatformLayer
6
6
  } from "./chunk-ZANGOPUQ.js";
7
7
  import {
8
8
  ReactPlatform
9
- } from "./chunk-4G7H66OY.js";
9
+ } from "./chunk-JC3R6GII.js";
10
10
  import {
11
11
  useDispatch,
12
12
  useImportedModule,
@@ -14,17 +14,17 @@ import {
14
14
  useLocalModule,
15
15
  useModuleList,
16
16
  useProcesses
17
- } from "./chunk-PYWHL7TA.js";
17
+ } from "./chunk-WOTNVLCD.js";
18
18
  import {
19
19
  shallow,
20
20
  useModule,
21
21
  useRuntime,
22
22
  useSelector
23
- } from "./chunk-UFFCJGSZ.js";
23
+ } from "./chunk-G2LX7WWQ.js";
24
24
  import "./chunk-VFWWMK67.js";
25
25
  import {
26
26
  RuntimeProvider
27
- } from "./chunk-JXAJTWSZ.js";
27
+ } from "./chunk-2M6MDNVT.js";
28
28
  import "./chunk-2WFULYPJ.js";
29
29
  export {
30
30
  ModuleScope,
@@ -1,9 +1,11 @@
1
1
  import React from 'react';
2
2
  import * as Logix from '@logixjs/core';
3
- import { c as ModuleRef, b as ModuleDispatchersOfShape, D as Dispatch } from './ModuleRef-wZSQ3Wwo.js';
3
+ import { d as ModuleRef, h as ModuleRefOfTag, g as ModuleRefOfModule, f as ModuleRefOfDef, D as Dispatch } from './ModuleRef-gZmL6Zvb.js';
4
4
  import { Effect } from 'effect';
5
5
 
6
6
  type ReactModuleHandle = Logix.ModuleRuntime<any, any> | Logix.ModuleTagType<any, any> | ModuleRef<any, any>;
7
+ type StateOfHandle<H> = H extends ModuleRef<infer S, any, any, any, any> ? S : H extends Logix.ModuleRuntime<infer S, any> ? S : H extends Logix.ModuleTagType<any, infer Sh> ? Logix.StateOf<Sh> : never;
8
+ type ActionOfHandle<H> = H extends ModuleRef<any, infer A, any, any, any> ? A : H extends Logix.ModuleRuntime<any, infer A> ? A : H extends Logix.ModuleTagType<any, infer Sh> ? Logix.ActionOf<Sh> : never;
7
9
 
8
10
  interface ModuleImplSyncOptions {
9
11
  readonly deps?: React.DependencyList;
@@ -44,20 +46,18 @@ interface ModuleImplSuspendOptions {
44
46
  }
45
47
  type ModuleImplOptions = ModuleImplSyncOptions | ModuleImplSuspendOptions;
46
48
  type ModuleDef$1<Id extends string, Sh extends Logix.AnyModuleShape, Ext extends object = {}> = Logix.Module.ModuleDef<Id, Sh, Ext>;
47
- type StateOfHandle$1<H> = H extends ModuleRef<infer S, infer _A> ? S : H extends Logix.ModuleRuntime<infer S, infer _A> ? S : H extends Logix.ModuleTagType<string, infer Sh> ? Logix.StateOf<Sh> : never;
48
- type ActionOfHandle$1<H> = H extends ModuleRef<infer _S, infer A> ? A : H extends Logix.ModuleRuntime<infer _S, infer A> ? A : H extends Logix.ModuleTagType<string, infer Sh> ? Logix.ActionOf<Sh> : never;
49
- declare function useModule<Id extends string, Sh extends Logix.AnyModuleShape, R = never>(handle: Logix.ModuleImpl<Id, Sh, R>): ModuleRef<Logix.StateOf<Sh>, Logix.ActionOf<Sh>, keyof Sh['actionMap'] & string, Logix.ModuleTagType<Id, Sh>, ModuleDispatchersOfShape<Sh>>;
50
- declare function useModule<Id extends string, Sh extends Logix.AnyModuleShape, R = never>(handle: Logix.ModuleImpl<Id, Sh, R>, options: ModuleImplOptions): ModuleRef<Logix.StateOf<Sh>, Logix.ActionOf<Sh>, keyof Sh['actionMap'] & string, Logix.ModuleTagType<Id, Sh>, ModuleDispatchersOfShape<Sh>>;
51
- declare function useModule<Id extends string, Sh extends Logix.AnyModuleShape, Ext extends object, R = never>(handle: Logix.Module.Module<Id, Sh, Ext, R>): ModuleRef<Logix.StateOf<Sh>, Logix.ActionOf<Sh>, keyof Sh['actionMap'] & string, Logix.Module.Module<Id, Sh, Ext, R>> & Ext;
52
- declare function useModule<Id extends string, Sh extends Logix.AnyModuleShape, Ext extends object, R = never>(handle: Logix.Module.Module<Id, Sh, Ext, R>, options: ModuleImplOptions): ModuleRef<Logix.StateOf<Sh>, Logix.ActionOf<Sh>, keyof Sh['actionMap'] & string, Logix.Module.Module<Id, Sh, Ext, R>> & Ext;
53
- declare function useModule<Id extends string, Sh extends Logix.AnyModuleShape, Ext extends object = {}>(handle: ModuleDef$1<Id, Sh, Ext>): ModuleRef<Logix.StateOf<Sh>, Logix.ActionOf<Sh>, keyof Sh['actionMap'] & string, ModuleDef$1<Id, Sh, Ext>> & Ext;
54
- declare function useModule<Id extends string, Sh extends Logix.AnyModuleShape>(handle: Logix.ModuleTagType<Id, Sh>): ModuleRef<Logix.StateOf<Sh>, Logix.ActionOf<Sh>, keyof Sh['actionMap'] & string, Logix.ModuleTagType<Id, Sh>, ModuleDispatchersOfShape<Sh>>;
55
- declare function useModule<H extends ReactModuleHandle>(handle: H): ModuleRef<StateOfHandle$1<H>, ActionOfHandle$1<H>>;
49
+ declare function useModule<Id extends string, Sh extends Logix.AnyModuleShape, R = never>(handle: Logix.ModuleImpl<Id, Sh, R>): ModuleRefOfTag<Id, Sh>;
50
+ declare function useModule<Id extends string, Sh extends Logix.AnyModuleShape, R = never>(handle: Logix.ModuleImpl<Id, Sh, R>, options: ModuleImplOptions): ModuleRefOfTag<Id, Sh>;
51
+ declare function useModule<Id extends string, Sh extends Logix.AnyModuleShape, Ext extends object, R = never>(handle: Logix.Module.Module<Id, Sh, Ext, R>): ModuleRefOfModule<Id, Sh, Ext, R>;
52
+ declare function useModule<Id extends string, Sh extends Logix.AnyModuleShape, Ext extends object, R = never>(handle: Logix.Module.Module<Id, Sh, Ext, R>, options: ModuleImplOptions): ModuleRefOfModule<Id, Sh, Ext, R>;
53
+ declare function useModule<Id extends string, Sh extends Logix.AnyModuleShape, Ext extends object = {}>(handle: ModuleDef$1<Id, Sh, Ext>): ModuleRefOfDef<Id, Sh, Ext>;
54
+ declare function useModule<Id extends string, Sh extends Logix.AnyModuleShape>(handle: Logix.ModuleTagType<Id, Sh>): ModuleRefOfTag<Id, Sh>;
55
+ declare function useModule<H extends ReactModuleHandle>(handle: H): ModuleRef<StateOfHandle<H>, ActionOfHandle<H>>;
56
56
  declare function useModule<Id extends string, Sh extends Logix.AnyModuleShape, R, V>(handle: Logix.ModuleImpl<Id, Sh, R>, selector: (state: Logix.StateOf<Sh>) => V, equalityFn?: (previous: V, next: V) => boolean): V;
57
57
  declare function useModule<Id extends string, Sh extends Logix.AnyModuleShape, R, V>(handle: Logix.Module.Module<Id, Sh, any, R>, selector: (state: Logix.StateOf<Sh>) => V, equalityFn?: (previous: V, next: V) => boolean): V;
58
58
  declare function useModule<Id extends string, Sh extends Logix.AnyModuleShape, V>(handle: ModuleDef$1<Id, Sh, any>, selector: (state: Logix.StateOf<Sh>) => V, equalityFn?: (previous: V, next: V) => boolean): V;
59
59
  declare function useModule<Id extends string, Sh extends Logix.AnyModuleShape, V>(handle: Logix.ModuleTagType<Id, Sh>, selector: (state: Logix.StateOf<Sh>) => V, equalityFn?: (previous: V, next: V) => boolean): V;
60
- declare function useModule<H extends ReactModuleHandle, V>(handle: H, selector: (state: StateOfHandle$1<H>) => V, equalityFn?: (previous: V, next: V) => boolean): V;
60
+ declare function useModule<H extends ReactModuleHandle, V>(handle: H, selector: (state: StateOfHandle<H>) => V, equalityFn?: (previous: V, next: V) => boolean): V;
61
61
 
62
62
  type LocalModuleFactory<S, A> = () => Effect.Effect<Logix.ModuleRuntime<S, A>, unknown, unknown>;
63
63
  type ModuleDef<Id extends string, Sh extends Logix.AnyModuleShape, Ext extends object = {}> = Logix.Module.ModuleDef<Id, Sh, Ext>;
@@ -68,14 +68,12 @@ interface ModuleTagOptions<Sh extends Logix.AnyModuleShape = Logix.AnyModuleShap
68
68
  readonly key?: string;
69
69
  }
70
70
  declare function useLocalModule<S, A>(factory: LocalModuleFactory<S, A>, deps?: React.DependencyList): ModuleRef<S, A>;
71
- declare function useLocalModule<Id extends string, Sh extends Logix.AnyModuleShape, Ext extends object = {}>(module: ModuleDef<Id, Sh, Ext>, options: ModuleTagOptions<Sh>): ModuleRef<Logix.StateOf<Sh>, Logix.ActionOf<Sh>, keyof Sh['actionMap'] & string, ModuleDef<Id, Sh, Ext>> & Ext;
72
- declare function useLocalModule<Sh extends Logix.AnyModuleShape>(module: Logix.ModuleTagType<string, Sh>, options: ModuleTagOptions<Sh>): ModuleRef<Logix.StateOf<Sh>, Logix.ActionOf<Sh>, keyof Sh['actionMap'] & string, Logix.ModuleTagType<string, Sh>>;
71
+ declare function useLocalModule<Id extends string, Sh extends Logix.AnyModuleShape, Ext extends object = {}>(module: ModuleDef<Id, Sh, Ext>, options: ModuleTagOptions<Sh>): ModuleRefOfDef<Id, Sh, Ext>;
72
+ declare function useLocalModule<Sh extends Logix.AnyModuleShape>(module: Logix.ModuleTagType<string, Sh>, options: ModuleTagOptions<Sh>): ModuleRefOfTag<string, Sh>;
73
73
 
74
- type StateOfHandle<H> = H extends ModuleRef<infer S, any> ? S : H extends Logix.ModuleRuntime<infer S, any> ? S : H extends Logix.ModuleTagType<any, infer Sh> ? Logix.StateOf<Sh> : never;
75
74
  declare function useSelector<H extends ReactModuleHandle>(handle: H): StateOfHandle<H>;
76
75
  declare function useSelector<H extends ReactModuleHandle, V>(handle: H, selector: (state: StateOfHandle<H>) => V, equalityFn?: (previous: V, next: V) => boolean): V;
77
76
 
78
- type ActionOfHandle<H> = H extends ModuleRef<any, infer A> ? A : H extends Logix.ModuleRuntime<any, infer A> ? A : H extends Logix.ModuleTagType<any, infer Sh> ? Logix.ActionOf<Sh> : never;
79
77
  declare function useDispatch<H extends ReactModuleHandle>(handle: H): Dispatch<ActionOfHandle<H>>;
80
78
 
81
79
  export { useLocalModule as a, useSelector as b, useDispatch as c, useModule as u };
@@ -1,9 +1,11 @@
1
1
  import React from 'react';
2
2
  import * as Logix from '@logixjs/core';
3
- import { c as ModuleRef, b as ModuleDispatchersOfShape, D as Dispatch } from './ModuleRef-wZSQ3Wwo.cjs';
3
+ import { d as ModuleRef, h as ModuleRefOfTag, g as ModuleRefOfModule, f as ModuleRefOfDef, D as Dispatch } from './ModuleRef-gZmL6Zvb.cjs';
4
4
  import { Effect } from 'effect';
5
5
 
6
6
  type ReactModuleHandle = Logix.ModuleRuntime<any, any> | Logix.ModuleTagType<any, any> | ModuleRef<any, any>;
7
+ type StateOfHandle<H> = H extends ModuleRef<infer S, any, any, any, any> ? S : H extends Logix.ModuleRuntime<infer S, any> ? S : H extends Logix.ModuleTagType<any, infer Sh> ? Logix.StateOf<Sh> : never;
8
+ type ActionOfHandle<H> = H extends ModuleRef<any, infer A, any, any, any> ? A : H extends Logix.ModuleRuntime<any, infer A> ? A : H extends Logix.ModuleTagType<any, infer Sh> ? Logix.ActionOf<Sh> : never;
7
9
 
8
10
  interface ModuleImplSyncOptions {
9
11
  readonly deps?: React.DependencyList;
@@ -44,20 +46,18 @@ interface ModuleImplSuspendOptions {
44
46
  }
45
47
  type ModuleImplOptions = ModuleImplSyncOptions | ModuleImplSuspendOptions;
46
48
  type ModuleDef$1<Id extends string, Sh extends Logix.AnyModuleShape, Ext extends object = {}> = Logix.Module.ModuleDef<Id, Sh, Ext>;
47
- type StateOfHandle$1<H> = H extends ModuleRef<infer S, infer _A> ? S : H extends Logix.ModuleRuntime<infer S, infer _A> ? S : H extends Logix.ModuleTagType<string, infer Sh> ? Logix.StateOf<Sh> : never;
48
- type ActionOfHandle$1<H> = H extends ModuleRef<infer _S, infer A> ? A : H extends Logix.ModuleRuntime<infer _S, infer A> ? A : H extends Logix.ModuleTagType<string, infer Sh> ? Logix.ActionOf<Sh> : never;
49
- declare function useModule<Id extends string, Sh extends Logix.AnyModuleShape, R = never>(handle: Logix.ModuleImpl<Id, Sh, R>): ModuleRef<Logix.StateOf<Sh>, Logix.ActionOf<Sh>, keyof Sh['actionMap'] & string, Logix.ModuleTagType<Id, Sh>, ModuleDispatchersOfShape<Sh>>;
50
- declare function useModule<Id extends string, Sh extends Logix.AnyModuleShape, R = never>(handle: Logix.ModuleImpl<Id, Sh, R>, options: ModuleImplOptions): ModuleRef<Logix.StateOf<Sh>, Logix.ActionOf<Sh>, keyof Sh['actionMap'] & string, Logix.ModuleTagType<Id, Sh>, ModuleDispatchersOfShape<Sh>>;
51
- declare function useModule<Id extends string, Sh extends Logix.AnyModuleShape, Ext extends object, R = never>(handle: Logix.Module.Module<Id, Sh, Ext, R>): ModuleRef<Logix.StateOf<Sh>, Logix.ActionOf<Sh>, keyof Sh['actionMap'] & string, Logix.Module.Module<Id, Sh, Ext, R>> & Ext;
52
- declare function useModule<Id extends string, Sh extends Logix.AnyModuleShape, Ext extends object, R = never>(handle: Logix.Module.Module<Id, Sh, Ext, R>, options: ModuleImplOptions): ModuleRef<Logix.StateOf<Sh>, Logix.ActionOf<Sh>, keyof Sh['actionMap'] & string, Logix.Module.Module<Id, Sh, Ext, R>> & Ext;
53
- declare function useModule<Id extends string, Sh extends Logix.AnyModuleShape, Ext extends object = {}>(handle: ModuleDef$1<Id, Sh, Ext>): ModuleRef<Logix.StateOf<Sh>, Logix.ActionOf<Sh>, keyof Sh['actionMap'] & string, ModuleDef$1<Id, Sh, Ext>> & Ext;
54
- declare function useModule<Id extends string, Sh extends Logix.AnyModuleShape>(handle: Logix.ModuleTagType<Id, Sh>): ModuleRef<Logix.StateOf<Sh>, Logix.ActionOf<Sh>, keyof Sh['actionMap'] & string, Logix.ModuleTagType<Id, Sh>, ModuleDispatchersOfShape<Sh>>;
55
- declare function useModule<H extends ReactModuleHandle>(handle: H): ModuleRef<StateOfHandle$1<H>, ActionOfHandle$1<H>>;
49
+ declare function useModule<Id extends string, Sh extends Logix.AnyModuleShape, R = never>(handle: Logix.ModuleImpl<Id, Sh, R>): ModuleRefOfTag<Id, Sh>;
50
+ declare function useModule<Id extends string, Sh extends Logix.AnyModuleShape, R = never>(handle: Logix.ModuleImpl<Id, Sh, R>, options: ModuleImplOptions): ModuleRefOfTag<Id, Sh>;
51
+ declare function useModule<Id extends string, Sh extends Logix.AnyModuleShape, Ext extends object, R = never>(handle: Logix.Module.Module<Id, Sh, Ext, R>): ModuleRefOfModule<Id, Sh, Ext, R>;
52
+ declare function useModule<Id extends string, Sh extends Logix.AnyModuleShape, Ext extends object, R = never>(handle: Logix.Module.Module<Id, Sh, Ext, R>, options: ModuleImplOptions): ModuleRefOfModule<Id, Sh, Ext, R>;
53
+ declare function useModule<Id extends string, Sh extends Logix.AnyModuleShape, Ext extends object = {}>(handle: ModuleDef$1<Id, Sh, Ext>): ModuleRefOfDef<Id, Sh, Ext>;
54
+ declare function useModule<Id extends string, Sh extends Logix.AnyModuleShape>(handle: Logix.ModuleTagType<Id, Sh>): ModuleRefOfTag<Id, Sh>;
55
+ declare function useModule<H extends ReactModuleHandle>(handle: H): ModuleRef<StateOfHandle<H>, ActionOfHandle<H>>;
56
56
  declare function useModule<Id extends string, Sh extends Logix.AnyModuleShape, R, V>(handle: Logix.ModuleImpl<Id, Sh, R>, selector: (state: Logix.StateOf<Sh>) => V, equalityFn?: (previous: V, next: V) => boolean): V;
57
57
  declare function useModule<Id extends string, Sh extends Logix.AnyModuleShape, R, V>(handle: Logix.Module.Module<Id, Sh, any, R>, selector: (state: Logix.StateOf<Sh>) => V, equalityFn?: (previous: V, next: V) => boolean): V;
58
58
  declare function useModule<Id extends string, Sh extends Logix.AnyModuleShape, V>(handle: ModuleDef$1<Id, Sh, any>, selector: (state: Logix.StateOf<Sh>) => V, equalityFn?: (previous: V, next: V) => boolean): V;
59
59
  declare function useModule<Id extends string, Sh extends Logix.AnyModuleShape, V>(handle: Logix.ModuleTagType<Id, Sh>, selector: (state: Logix.StateOf<Sh>) => V, equalityFn?: (previous: V, next: V) => boolean): V;
60
- declare function useModule<H extends ReactModuleHandle, V>(handle: H, selector: (state: StateOfHandle$1<H>) => V, equalityFn?: (previous: V, next: V) => boolean): V;
60
+ declare function useModule<H extends ReactModuleHandle, V>(handle: H, selector: (state: StateOfHandle<H>) => V, equalityFn?: (previous: V, next: V) => boolean): V;
61
61
 
62
62
  type LocalModuleFactory<S, A> = () => Effect.Effect<Logix.ModuleRuntime<S, A>, unknown, unknown>;
63
63
  type ModuleDef<Id extends string, Sh extends Logix.AnyModuleShape, Ext extends object = {}> = Logix.Module.ModuleDef<Id, Sh, Ext>;
@@ -68,14 +68,12 @@ interface ModuleTagOptions<Sh extends Logix.AnyModuleShape = Logix.AnyModuleShap
68
68
  readonly key?: string;
69
69
  }
70
70
  declare function useLocalModule<S, A>(factory: LocalModuleFactory<S, A>, deps?: React.DependencyList): ModuleRef<S, A>;
71
- declare function useLocalModule<Id extends string, Sh extends Logix.AnyModuleShape, Ext extends object = {}>(module: ModuleDef<Id, Sh, Ext>, options: ModuleTagOptions<Sh>): ModuleRef<Logix.StateOf<Sh>, Logix.ActionOf<Sh>, keyof Sh['actionMap'] & string, ModuleDef<Id, Sh, Ext>> & Ext;
72
- declare function useLocalModule<Sh extends Logix.AnyModuleShape>(module: Logix.ModuleTagType<string, Sh>, options: ModuleTagOptions<Sh>): ModuleRef<Logix.StateOf<Sh>, Logix.ActionOf<Sh>, keyof Sh['actionMap'] & string, Logix.ModuleTagType<string, Sh>>;
71
+ declare function useLocalModule<Id extends string, Sh extends Logix.AnyModuleShape, Ext extends object = {}>(module: ModuleDef<Id, Sh, Ext>, options: ModuleTagOptions<Sh>): ModuleRefOfDef<Id, Sh, Ext>;
72
+ declare function useLocalModule<Sh extends Logix.AnyModuleShape>(module: Logix.ModuleTagType<string, Sh>, options: ModuleTagOptions<Sh>): ModuleRefOfTag<string, Sh>;
73
73
 
74
- type StateOfHandle<H> = H extends ModuleRef<infer S, any> ? S : H extends Logix.ModuleRuntime<infer S, any> ? S : H extends Logix.ModuleTagType<any, infer Sh> ? Logix.StateOf<Sh> : never;
75
74
  declare function useSelector<H extends ReactModuleHandle>(handle: H): StateOfHandle<H>;
76
75
  declare function useSelector<H extends ReactModuleHandle, V>(handle: H, selector: (state: StateOfHandle<H>) => V, equalityFn?: (previous: V, next: V) => boolean): V;
77
76
 
78
- type ActionOfHandle<H> = H extends ModuleRef<any, infer A> ? A : H extends Logix.ModuleRuntime<any, infer A> ? A : H extends Logix.ModuleTagType<any, infer Sh> ? Logix.ActionOf<Sh> : never;
79
77
  declare function useDispatch<H extends ReactModuleHandle>(handle: H): Dispatch<ActionOfHandle<H>>;
80
78
 
81
79
  export { useLocalModule as a, useSelector as b, useDispatch as c, useModule as u };
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@logixjs/react",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
+ "license": "Apache-2.0",
4
5
  "files": [
5
6
  "dist/**"
6
7
  ],
@@ -28,7 +29,7 @@
28
29
  "dependencies": {
29
30
  "effect": "^3.19.8",
30
31
  "use-sync-external-store": "^1.2.0",
31
- "@logixjs/core": "0.0.1"
32
+ "@logixjs/core": "0.0.2"
32
33
  },
33
34
  "devDependencies": {
34
35
  "@testing-library/react": "^16.0.1",
@@ -39,7 +40,9 @@
39
40
  "react-dom": "^19.2.0",
40
41
  "tsup": "^8.1.0",
41
42
  "typescript": "^5.4.5",
42
- "vitest": "^4.0.15"
43
+ "vitest": "^4.0.15",
44
+ "@logixjs/test": "0.0.2",
45
+ "@logixjs/perf-evidence": "0.0.0"
43
46
  },
44
47
  "peerDependencies": {
45
48
  "react": ">=19.0.0"