@logixjs/react 0.1.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 (42) hide show
  1. package/README.md +64 -0
  2. package/dist/Hooks.cjs +2194 -0
  3. package/dist/Hooks.d.cts +77 -0
  4. package/dist/Hooks.d.ts +77 -0
  5. package/dist/Hooks.js +27 -0
  6. package/dist/ModuleRef-wZSQ3Wwo.d.cts +73 -0
  7. package/dist/ModuleRef-wZSQ3Wwo.d.ts +73 -0
  8. package/dist/ModuleScope.cjs +2695 -0
  9. package/dist/ModuleScope.d.cts +62 -0
  10. package/dist/ModuleScope.d.ts +62 -0
  11. package/dist/ModuleScope.js +9 -0
  12. package/dist/Platform.cjs +60 -0
  13. package/dist/Platform.d.cts +6 -0
  14. package/dist/Platform.d.ts +6 -0
  15. package/dist/Platform.js +6 -0
  16. package/dist/ReactPlatform.cjs +2813 -0
  17. package/dist/ReactPlatform.d.cts +40 -0
  18. package/dist/ReactPlatform.d.ts +40 -0
  19. package/dist/ReactPlatform.js +11 -0
  20. package/dist/RuntimeProvider.cjs +1618 -0
  21. package/dist/RuntimeProvider.d.cts +66 -0
  22. package/dist/RuntimeProvider.d.ts +66 -0
  23. package/dist/RuntimeProvider.js +8 -0
  24. package/dist/chunk-2WFULYPJ.js +856 -0
  25. package/dist/chunk-4G7H66OY.js +54 -0
  26. package/dist/chunk-G5MRIFKK.js +95 -0
  27. package/dist/chunk-JXAJTWSZ.js +773 -0
  28. package/dist/chunk-PYWHL7TA.js +351 -0
  29. package/dist/chunk-UFFCJGSZ.js +981 -0
  30. package/dist/chunk-VFWWMK67.js +0 -0
  31. package/dist/chunk-ZANGOPUQ.js +34 -0
  32. package/dist/global.d.cjs +1 -0
  33. package/dist/global.d.d.cts +9 -0
  34. package/dist/global.d.d.ts +9 -0
  35. package/dist/global.d.js +0 -0
  36. package/dist/index.cjs +3118 -0
  37. package/dist/index.d.cts +10 -0
  38. package/dist/index.d.ts +10 -0
  39. package/dist/index.js +44 -0
  40. package/dist/useDispatch-BnzYVkRE.d.ts +81 -0
  41. package/dist/useDispatch-CnO5-66H.d.cts +81 -0
  42. package/package.json +58 -0
@@ -0,0 +1,10 @@
1
+ export { ModuleHandle, ModulePreloadPolicy, RuntimeProvider, RuntimeProviderErrorContext, RuntimeProviderPolicy, RuntimeProviderPolicyMode, RuntimeProviderProps, YieldPolicy, YieldStrategy } from './RuntimeProvider.cjs';
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';
4
+ export { ReactPlatformLayer } from './Platform.cjs';
5
+ export { ReactPlatform } from './ReactPlatform.cjs';
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';
8
+ import 'react';
9
+ import 'effect';
10
+ import '@logixjs/core';
@@ -0,0 +1,10 @@
1
+ export { ModuleHandle, ModulePreloadPolicy, RuntimeProvider, RuntimeProviderErrorContext, RuntimeProviderPolicy, RuntimeProviderPolicyMode, RuntimeProviderProps, YieldPolicy, YieldStrategy } from './RuntimeProvider.js';
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';
4
+ export { ReactPlatformLayer } from './Platform.js';
5
+ export { ReactPlatform } from './ReactPlatform.js';
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';
8
+ import 'react';
9
+ import 'effect';
10
+ import '@logixjs/core';
package/dist/index.js ADDED
@@ -0,0 +1,44 @@
1
+ import {
2
+ ModuleScope
3
+ } from "./chunk-G5MRIFKK.js";
4
+ import {
5
+ ReactPlatformLayer
6
+ } from "./chunk-ZANGOPUQ.js";
7
+ import {
8
+ ReactPlatform
9
+ } from "./chunk-4G7H66OY.js";
10
+ import {
11
+ useDispatch,
12
+ useImportedModule,
13
+ useLayerModule,
14
+ useLocalModule,
15
+ useModuleList,
16
+ useProcesses
17
+ } from "./chunk-PYWHL7TA.js";
18
+ import {
19
+ shallow,
20
+ useModule,
21
+ useRuntime,
22
+ useSelector
23
+ } from "./chunk-UFFCJGSZ.js";
24
+ import "./chunk-VFWWMK67.js";
25
+ import {
26
+ RuntimeProvider
27
+ } from "./chunk-JXAJTWSZ.js";
28
+ import "./chunk-2WFULYPJ.js";
29
+ export {
30
+ ModuleScope,
31
+ ReactPlatform,
32
+ ReactPlatformLayer,
33
+ RuntimeProvider,
34
+ shallow,
35
+ useDispatch,
36
+ useImportedModule,
37
+ useLayerModule,
38
+ useLocalModule,
39
+ useModule,
40
+ useModuleList,
41
+ useProcesses,
42
+ useRuntime,
43
+ useSelector
44
+ };
@@ -0,0 +1,81 @@
1
+ import React from 'react';
2
+ import * as Logix from '@logixjs/core';
3
+ import { c as ModuleRef, b as ModuleDispatchersOfShape, D as Dispatch } from './ModuleRef-wZSQ3Wwo.js';
4
+ import { Effect } from 'effect';
5
+
6
+ type ReactModuleHandle = Logix.ModuleRuntime<any, any> | Logix.ModuleTagType<any, any> | ModuleRef<any, any>;
7
+
8
+ interface ModuleImplSyncOptions {
9
+ readonly deps?: React.DependencyList;
10
+ readonly key?: string;
11
+ readonly suspend?: false | undefined;
12
+ readonly initTimeoutMs?: number;
13
+ /**
14
+ * Keep-alive time (ms) after this ModuleRuntime has no holders (refCount=0).
15
+ * - Defaults to ModuleCache's default (~500ms) to absorb StrictMode jitter.
16
+ * - For session-level use cases, you can set a longer time, e.g. 5 minutes.
17
+ */
18
+ readonly gcTime?: number;
19
+ /**
20
+ * (Optional) instance label: a friendly name for DevTools / debugging views.
21
+ * - If omitted, when DevTools is enabled it falls back to key or auto numbering (Instance #1/#2).
22
+ * - Recommended for multi-instance scenarios like sessions/shards, e.g. "Session A" / "Session B".
23
+ */
24
+ readonly label?: string;
25
+ }
26
+ interface ModuleImplSuspendOptions {
27
+ readonly deps?: React.DependencyList;
28
+ readonly key: string;
29
+ readonly suspend: true;
30
+ readonly gcTime?: number;
31
+ /**
32
+ * Max pending time (ms) allowed for module initialization (including async Layer building).
33
+ * - Only applies when suspend:true.
34
+ * - If it still hasn't finished after this time, it fails via Effect.timeoutFail and the caller's ErrorBoundary
35
+ * (or upper-layer logic) decides retry/degrade strategy.
36
+ * - Does not change gcTime semantics: gcTime still only describes keep-alive time after there are no holders.
37
+ */
38
+ readonly initTimeoutMs?: number;
39
+ /**
40
+ * (Optional) instance label: a friendly name for DevTools / debugging views.
41
+ * - If omitted, when DevTools is enabled it falls back to key or auto numbering.
42
+ */
43
+ readonly label?: string;
44
+ }
45
+ type ModuleImplOptions = ModuleImplSyncOptions | ModuleImplSuspendOptions;
46
+ 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>>;
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
+ 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
+ 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
+ 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;
61
+
62
+ type LocalModuleFactory<S, A> = () => Effect.Effect<Logix.ModuleRuntime<S, A>, unknown, unknown>;
63
+ type ModuleDef<Id extends string, Sh extends Logix.AnyModuleShape, Ext extends object = {}> = Logix.Module.ModuleDef<Id, Sh, Ext>;
64
+ interface ModuleTagOptions<Sh extends Logix.AnyModuleShape = Logix.AnyModuleShape> {
65
+ readonly initial: Logix.StateOf<Sh>;
66
+ readonly logics?: ReadonlyArray<Logix.ModuleLogic<Sh>>;
67
+ readonly deps?: React.DependencyList;
68
+ readonly key?: string;
69
+ }
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>>;
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
+ declare function useSelector<H extends ReactModuleHandle>(handle: H): StateOfHandle<H>;
76
+ declare function useSelector<H extends ReactModuleHandle, V>(handle: H, selector: (state: StateOfHandle<H>) => V, equalityFn?: (previous: V, next: V) => boolean): V;
77
+
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
+ declare function useDispatch<H extends ReactModuleHandle>(handle: H): Dispatch<ActionOfHandle<H>>;
80
+
81
+ export { useLocalModule as a, useSelector as b, useDispatch as c, useModule as u };
@@ -0,0 +1,81 @@
1
+ import React from 'react';
2
+ import * as Logix from '@logixjs/core';
3
+ import { c as ModuleRef, b as ModuleDispatchersOfShape, D as Dispatch } from './ModuleRef-wZSQ3Wwo.cjs';
4
+ import { Effect } from 'effect';
5
+
6
+ type ReactModuleHandle = Logix.ModuleRuntime<any, any> | Logix.ModuleTagType<any, any> | ModuleRef<any, any>;
7
+
8
+ interface ModuleImplSyncOptions {
9
+ readonly deps?: React.DependencyList;
10
+ readonly key?: string;
11
+ readonly suspend?: false | undefined;
12
+ readonly initTimeoutMs?: number;
13
+ /**
14
+ * Keep-alive time (ms) after this ModuleRuntime has no holders (refCount=0).
15
+ * - Defaults to ModuleCache's default (~500ms) to absorb StrictMode jitter.
16
+ * - For session-level use cases, you can set a longer time, e.g. 5 minutes.
17
+ */
18
+ readonly gcTime?: number;
19
+ /**
20
+ * (Optional) instance label: a friendly name for DevTools / debugging views.
21
+ * - If omitted, when DevTools is enabled it falls back to key or auto numbering (Instance #1/#2).
22
+ * - Recommended for multi-instance scenarios like sessions/shards, e.g. "Session A" / "Session B".
23
+ */
24
+ readonly label?: string;
25
+ }
26
+ interface ModuleImplSuspendOptions {
27
+ readonly deps?: React.DependencyList;
28
+ readonly key: string;
29
+ readonly suspend: true;
30
+ readonly gcTime?: number;
31
+ /**
32
+ * Max pending time (ms) allowed for module initialization (including async Layer building).
33
+ * - Only applies when suspend:true.
34
+ * - If it still hasn't finished after this time, it fails via Effect.timeoutFail and the caller's ErrorBoundary
35
+ * (or upper-layer logic) decides retry/degrade strategy.
36
+ * - Does not change gcTime semantics: gcTime still only describes keep-alive time after there are no holders.
37
+ */
38
+ readonly initTimeoutMs?: number;
39
+ /**
40
+ * (Optional) instance label: a friendly name for DevTools / debugging views.
41
+ * - If omitted, when DevTools is enabled it falls back to key or auto numbering.
42
+ */
43
+ readonly label?: string;
44
+ }
45
+ type ModuleImplOptions = ModuleImplSyncOptions | ModuleImplSuspendOptions;
46
+ 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>>;
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
+ 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
+ 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
+ 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;
61
+
62
+ type LocalModuleFactory<S, A> = () => Effect.Effect<Logix.ModuleRuntime<S, A>, unknown, unknown>;
63
+ type ModuleDef<Id extends string, Sh extends Logix.AnyModuleShape, Ext extends object = {}> = Logix.Module.ModuleDef<Id, Sh, Ext>;
64
+ interface ModuleTagOptions<Sh extends Logix.AnyModuleShape = Logix.AnyModuleShape> {
65
+ readonly initial: Logix.StateOf<Sh>;
66
+ readonly logics?: ReadonlyArray<Logix.ModuleLogic<Sh>>;
67
+ readonly deps?: React.DependencyList;
68
+ readonly key?: string;
69
+ }
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>>;
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
+ declare function useSelector<H extends ReactModuleHandle>(handle: H): StateOfHandle<H>;
76
+ declare function useSelector<H extends ReactModuleHandle, V>(handle: H, selector: (state: StateOfHandle<H>) => V, equalityFn?: (previous: V, next: V) => boolean): V;
77
+
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
+ declare function useDispatch<H extends ReactModuleHandle>(handle: H): Dispatch<ActionOfHandle<H>>;
80
+
81
+ export { useLocalModule as a, useSelector as b, useDispatch as c, useModule as u };
package/package.json ADDED
@@ -0,0 +1,58 @@
1
+ {
2
+ "name": "@logixjs/react",
3
+ "version": "0.1.0",
4
+ "files": [
5
+ "dist/**"
6
+ ],
7
+ "type": "module",
8
+ "main": "dist/index.cjs",
9
+ "module": "dist/index.js",
10
+ "types": "dist/index.d.ts",
11
+ "exports": {
12
+ "./package.json": "./package.json",
13
+ ".": {
14
+ "types": "./dist/index.d.ts",
15
+ "import": "./dist/index.js",
16
+ "require": "./dist/index.cjs"
17
+ },
18
+ "./*": {
19
+ "types": "./dist/*.d.ts",
20
+ "import": "./dist/*.js",
21
+ "require": "./dist/*.cjs"
22
+ },
23
+ "./internal/*": null
24
+ },
25
+ "publishConfig": {
26
+ "access": "public"
27
+ },
28
+ "dependencies": {
29
+ "effect": "^3.19.8",
30
+ "use-sync-external-store": "^1.2.0",
31
+ "@logixjs/core": "0.0.1"
32
+ },
33
+ "devDependencies": {
34
+ "@testing-library/react": "^16.0.1",
35
+ "@types/react": "^19.2.2",
36
+ "@types/use-sync-external-store": "^1.5.0",
37
+ "jsdom": "24.0.0",
38
+ "react": "^19.2.0",
39
+ "react-dom": "^19.2.0",
40
+ "tsup": "^8.1.0",
41
+ "typescript": "^5.4.5",
42
+ "vitest": "^4.0.15"
43
+ },
44
+ "peerDependencies": {
45
+ "react": ">=19.0.0"
46
+ },
47
+ "scripts": {
48
+ "build": "tsup",
49
+ "dev": "tsup --watch",
50
+ "lint": "eslint src",
51
+ "test": "vitest run",
52
+ "test:changed": "vitest run --changed",
53
+ "test:cache": "vitest run --cache",
54
+ "test:watch": "vitest",
55
+ "typecheck": "tsc -p tsconfig.test.json --noEmit",
56
+ "typecheck:test": "tsc -p tsconfig.test.json --noEmit"
57
+ }
58
+ }