@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.
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import * as Logix from '@logixjs/core';
3
- import { c as ModuleRef, b as ModuleDispatchersOfShape } from './ModuleRef-wZSQ3Wwo.cjs';
3
+ import { h as ModuleRefOfTag, g as ModuleRefOfModule } from './ModuleRef-gZmL6Zvb.cjs';
4
4
 
5
5
  type ModuleScopeOptions = {
6
6
  readonly deps?: React.DependencyList;
@@ -38,7 +38,7 @@ type ModuleScope<Ref> = {
38
38
  * - const host = scope.use()
39
39
  * - const child = host.imports.get(Child.tag)
40
40
  */
41
- readonly useImported: <Id extends string, Sh extends Logix.AnyModuleShape>(module: Logix.ModuleTagType<Id, Sh>) => ModuleRef<Logix.StateOf<Sh>, Logix.ActionOf<Sh>, keyof Sh['actionMap'] & string, Logix.ModuleTagType<Id, Sh>, ModuleDispatchersOfShape<Sh>>;
41
+ readonly useImported: <Id extends string, Sh extends Logix.AnyModuleShape>(module: Logix.ModuleTagType<Id, Sh>) => ModuleRefOfTag<Id, Sh>;
42
42
  readonly Context: React.Context<Ref | null>;
43
43
  /**
44
44
  * Bridge: reuse the same scope across React subtrees / separate roots.
@@ -54,8 +54,8 @@ type ModuleScope<Ref> = {
54
54
  };
55
55
  declare const ModuleScope: {
56
56
  readonly make: {
57
- <Id extends string, Sh extends Logix.AnyModuleShape, R = never>(handle: Logix.ModuleImpl<Id, Sh, R>, defaults?: ModuleScopeOptions): ModuleScope<ModuleRef<Logix.StateOf<Sh>, Logix.ActionOf<Sh>>>;
58
- <Id extends string, Sh extends Logix.AnyModuleShape, Ext extends object, R = never>(handle: Logix.Module.Module<Id, Sh, Ext, R>, defaults?: ModuleScopeOptions): ModuleScope<ModuleRef<Logix.StateOf<Sh>, Logix.ActionOf<Sh>> & Ext>;
57
+ <Id extends string, Sh extends Logix.AnyModuleShape, R = never>(handle: Logix.ModuleImpl<Id, Sh, R>, defaults?: ModuleScopeOptions): ModuleScope<ModuleRefOfTag<Id, Sh>>;
58
+ <Id extends string, Sh extends Logix.AnyModuleShape, Ext extends object, R = never>(handle: Logix.Module.Module<Id, Sh, Ext, R>, defaults?: ModuleScopeOptions): ModuleScope<ModuleRefOfModule<Id, Sh, Ext, R>>;
59
59
  };
60
60
  };
61
61
 
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import * as Logix from '@logixjs/core';
3
- import { c as ModuleRef, b as ModuleDispatchersOfShape } from './ModuleRef-wZSQ3Wwo.js';
3
+ import { h as ModuleRefOfTag, g as ModuleRefOfModule } from './ModuleRef-gZmL6Zvb.js';
4
4
 
5
5
  type ModuleScopeOptions = {
6
6
  readonly deps?: React.DependencyList;
@@ -38,7 +38,7 @@ type ModuleScope<Ref> = {
38
38
  * - const host = scope.use()
39
39
  * - const child = host.imports.get(Child.tag)
40
40
  */
41
- readonly useImported: <Id extends string, Sh extends Logix.AnyModuleShape>(module: Logix.ModuleTagType<Id, Sh>) => ModuleRef<Logix.StateOf<Sh>, Logix.ActionOf<Sh>, keyof Sh['actionMap'] & string, Logix.ModuleTagType<Id, Sh>, ModuleDispatchersOfShape<Sh>>;
41
+ readonly useImported: <Id extends string, Sh extends Logix.AnyModuleShape>(module: Logix.ModuleTagType<Id, Sh>) => ModuleRefOfTag<Id, Sh>;
42
42
  readonly Context: React.Context<Ref | null>;
43
43
  /**
44
44
  * Bridge: reuse the same scope across React subtrees / separate roots.
@@ -54,8 +54,8 @@ type ModuleScope<Ref> = {
54
54
  };
55
55
  declare const ModuleScope: {
56
56
  readonly make: {
57
- <Id extends string, Sh extends Logix.AnyModuleShape, R = never>(handle: Logix.ModuleImpl<Id, Sh, R>, defaults?: ModuleScopeOptions): ModuleScope<ModuleRef<Logix.StateOf<Sh>, Logix.ActionOf<Sh>>>;
58
- <Id extends string, Sh extends Logix.AnyModuleShape, Ext extends object, R = never>(handle: Logix.Module.Module<Id, Sh, Ext, R>, defaults?: ModuleScopeOptions): ModuleScope<ModuleRef<Logix.StateOf<Sh>, Logix.ActionOf<Sh>> & Ext>;
57
+ <Id extends string, Sh extends Logix.AnyModuleShape, R = never>(handle: Logix.ModuleImpl<Id, Sh, R>, defaults?: ModuleScopeOptions): ModuleScope<ModuleRefOfTag<Id, Sh>>;
58
+ <Id extends string, Sh extends Logix.AnyModuleShape, Ext extends object, R = never>(handle: Logix.Module.Module<Id, Sh, Ext, R>, defaults?: ModuleScopeOptions): ModuleScope<ModuleRefOfModule<Id, Sh, Ext, R>>;
59
59
  };
60
60
  };
61
61
 
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  ModuleScope
3
- } from "./chunk-G5MRIFKK.js";
4
- import "./chunk-UFFCJGSZ.js";
5
- import "./chunk-JXAJTWSZ.js";
3
+ } from "./chunk-STTE4SOJ.js";
4
+ import "./chunk-G2LX7WWQ.js";
5
+ import "./chunk-2M6MDNVT.js";
6
6
  import "./chunk-2WFULYPJ.js";
7
7
  export {
8
8
  ModuleScope