@logixjs/core 0.0.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/Action-BkRHy2vg.d.cts +10 -0
- package/dist/Action-mqVvtEHt.d.ts +10 -0
- package/dist/Action.cjs +57 -0
- package/dist/Action.cjs.map +1 -0
- package/dist/Action.d.cts +2 -0
- package/dist/Action.d.ts +2 -0
- package/dist/Action.js +9 -0
- package/dist/Action.js.map +1 -0
- package/dist/Actions-AsQ07yTP.d.cts +22 -0
- package/dist/Actions-AsQ07yTP.d.ts +22 -0
- package/dist/Actions.cjs +19 -0
- package/dist/Actions.cjs.map +1 -0
- package/dist/Actions.d.cts +2 -0
- package/dist/Actions.d.ts +2 -0
- package/dist/Actions.js +2 -0
- package/dist/Actions.js.map +1 -0
- package/dist/Bound-BN1DQ_lM.d.ts +23 -0
- package/dist/Bound-BPIfH9SS.d.cts +23 -0
- package/dist/Bound.cjs +1532 -0
- package/dist/Bound.cjs.map +1 -0
- package/dist/Bound.d.cts +7 -0
- package/dist/Bound.d.ts +7 -0
- package/dist/Bound.js +25 -0
- package/dist/Bound.js.map +1 -0
- package/dist/Debug-B5q5Bkzx.d.ts +320 -0
- package/dist/Debug-Bq8Sqjcr.d.cts +320 -0
- package/dist/Debug.cjs +1821 -0
- package/dist/Debug.cjs.map +1 -0
- package/dist/Debug.d.cts +13 -0
- package/dist/Debug.d.ts +13 -0
- package/dist/Debug.js +76 -0
- package/dist/Debug.js.map +1 -0
- package/dist/EffectOp.cjs +169 -0
- package/dist/EffectOp.cjs.map +1 -0
- package/dist/EffectOp.d.cts +118 -0
- package/dist/EffectOp.d.ts +118 -0
- package/dist/EffectOp.js +28 -0
- package/dist/EffectOp.js.map +1 -0
- package/dist/Env-DuJ6JrU2.d.cts +10 -0
- package/dist/Env-DuJ6JrU2.d.ts +10 -0
- package/dist/Env.cjs +60 -0
- package/dist/Env.cjs.map +1 -0
- package/dist/Env.d.cts +1 -0
- package/dist/Env.d.ts +1 -0
- package/dist/Env.js +11 -0
- package/dist/Env.js.map +1 -0
- package/dist/Flow-1fZT8MpX.d.cts +152 -0
- package/dist/Flow-BhpjE22E.d.ts +152 -0
- package/dist/Flow.cjs +504 -0
- package/dist/Flow.cjs.map +1 -0
- package/dist/Flow.d.cts +8 -0
- package/dist/Flow.d.ts +8 -0
- package/dist/Flow.js +15 -0
- package/dist/Flow.js.map +1 -0
- package/dist/Handle-D8D1zPb_.d.cts +30 -0
- package/dist/Handle-D_cLW1Z3.d.ts +30 -0
- package/dist/Handle.cjs +42 -0
- package/dist/Handle.cjs.map +1 -0
- package/dist/Handle.d.cts +7 -0
- package/dist/Handle.d.ts +7 -0
- package/dist/Handle.js +10 -0
- package/dist/Handle.js.map +1 -0
- package/dist/Kernel-8kC-jOda.d.cts +171 -0
- package/dist/Kernel-CnGE1Fyk.d.ts +171 -0
- package/dist/Kernel.cjs +284 -0
- package/dist/Kernel.cjs.map +1 -0
- package/dist/Kernel.d.cts +14 -0
- package/dist/Kernel.d.ts +14 -0
- package/dist/Kernel.js +36 -0
- package/dist/Kernel.js.map +1 -0
- package/dist/Link-Db7975nU.d.ts +45 -0
- package/dist/Link-fX8x1eCK.d.cts +45 -0
- package/dist/Link.cjs +542 -0
- package/dist/Link.cjs.map +1 -0
- package/dist/Link.d.cts +7 -0
- package/dist/Link.d.ts +7 -0
- package/dist/Link.js +35 -0
- package/dist/Link.js.map +1 -0
- package/dist/Logic-BRjEMr-W.d.ts +38 -0
- package/dist/Logic-DRh4sDZj.d.cts +38 -0
- package/dist/Logic.cjs +37 -0
- package/dist/Logic.cjs.map +1 -0
- package/dist/Logic.d.cts +7 -0
- package/dist/Logic.d.ts +7 -0
- package/dist/Logic.js +10 -0
- package/dist/Logic.js.map +1 -0
- package/dist/MatchBuilder-0QOc-nlU.d.ts +14 -0
- package/dist/MatchBuilder-CJk5oCkR.d.cts +14 -0
- package/dist/MatchBuilder.cjs +85 -0
- package/dist/MatchBuilder.cjs.map +1 -0
- package/dist/MatchBuilder.d.cts +8 -0
- package/dist/MatchBuilder.d.ts +8 -0
- package/dist/MatchBuilder.js +11 -0
- package/dist/MatchBuilder.js.map +1 -0
- package/dist/Middleware.cjs +411 -0
- package/dist/Middleware.cjs.map +1 -0
- package/dist/Middleware.d.cts +88 -0
- package/dist/Middleware.d.ts +88 -0
- package/dist/Middleware.js +27 -0
- package/dist/Middleware.js.map +1 -0
- package/dist/Module-B_0xRDMR.d.cts +203 -0
- package/dist/Module-DnzluX2J.d.ts +203 -0
- package/dist/Module.cjs +13512 -0
- package/dist/Module.cjs.map +1 -0
- package/dist/Module.d.cts +8 -0
- package/dist/Module.d.ts +8 -0
- package/dist/Module.js +53 -0
- package/dist/Module.js.map +1 -0
- package/dist/ModuleTag-C8FHY_sY.d.ts +93 -0
- package/dist/ModuleTag-EGbgBMpZ.d.cts +93 -0
- package/dist/ModuleTag.cjs +12231 -0
- package/dist/ModuleTag.cjs.map +1 -0
- package/dist/ModuleTag.d.cts +8 -0
- package/dist/ModuleTag.d.ts +8 -0
- package/dist/ModuleTag.js +39 -0
- package/dist/ModuleTag.js.map +1 -0
- package/dist/Observability-COqEvp2C.d.cts +713 -0
- package/dist/Observability-cY4kLn0S.d.ts +713 -0
- package/dist/Observability.cjs +5865 -0
- package/dist/Observability.cjs.map +1 -0
- package/dist/Observability.d.cts +9 -0
- package/dist/Observability.d.ts +9 -0
- package/dist/Observability.js +41 -0
- package/dist/Observability.js.map +1 -0
- package/dist/Platform-C49Pv956.d.cts +21 -0
- package/dist/Platform-C49Pv956.d.ts +21 -0
- package/dist/Platform-CHX8o-U4.d.ts +51 -0
- package/dist/Platform-CVlv0xLQ.d.cts +51 -0
- package/dist/Platform.cjs +58 -0
- package/dist/Platform.cjs.map +1 -0
- package/dist/Platform.d.cts +4 -0
- package/dist/Platform.d.ts +4 -0
- package/dist/Platform.js +15 -0
- package/dist/Platform.js.map +1 -0
- package/dist/Process-CM9xbMdP.d.ts +92 -0
- package/dist/Process-mL8fHDSB.d.cts +92 -0
- package/dist/Process.cjs +575 -0
- package/dist/Process.cjs.map +1 -0
- package/dist/Process.d.cts +8 -0
- package/dist/Process.d.ts +8 -0
- package/dist/Process.js +42 -0
- package/dist/Process.js.map +1 -0
- package/dist/ReadQuery-BlMwhe-F.d.ts +30 -0
- package/dist/ReadQuery-CL5XlXts.d.cts +30 -0
- package/dist/ReadQuery-SinbStGF.d.cts +38 -0
- package/dist/ReadQuery-SinbStGF.d.ts +38 -0
- package/dist/ReadQuery.cjs +377 -0
- package/dist/ReadQuery.cjs.map +1 -0
- package/dist/ReadQuery.d.cts +2 -0
- package/dist/ReadQuery.d.ts +2 -0
- package/dist/ReadQuery.js +14 -0
- package/dist/ReadQuery.js.map +1 -0
- package/dist/Reflection-CQnKwPXj.d.ts +182 -0
- package/dist/Reflection-Kabo1mlU.d.cts +182 -0
- package/dist/Reflection.cjs +2954 -0
- package/dist/Reflection.cjs.map +1 -0
- package/dist/Reflection.d.cts +17 -0
- package/dist/Reflection.d.ts +17 -0
- package/dist/Reflection.js +40 -0
- package/dist/Reflection.js.map +1 -0
- package/dist/Resource-Dy1xD_DG.d.cts +75 -0
- package/dist/Resource-Dy1xD_DG.d.ts +75 -0
- package/dist/Resource.cjs +166 -0
- package/dist/Resource.cjs.map +1 -0
- package/dist/Resource.d.cts +3 -0
- package/dist/Resource.d.ts +3 -0
- package/dist/Resource.js +21 -0
- package/dist/Resource.js.map +1 -0
- package/dist/Root-7ADUMk4t.d.cts +29 -0
- package/dist/Root-7ADUMk4t.d.ts +29 -0
- package/dist/Root.cjs +125 -0
- package/dist/Root.cjs.map +1 -0
- package/dist/Root.d.cts +4 -0
- package/dist/Root.d.ts +4 -0
- package/dist/Root.js +12 -0
- package/dist/Root.js.map +1 -0
- package/dist/Runtime-B-aL-f29.d.cts +274 -0
- package/dist/Runtime-CtyzZG4i.d.ts +274 -0
- package/dist/Runtime.cjs +5740 -0
- package/dist/Runtime.cjs.map +1 -0
- package/dist/Runtime.d.cts +19 -0
- package/dist/Runtime.d.ts +19 -0
- package/dist/Runtime.js +62 -0
- package/dist/Runtime.js.map +1 -0
- package/dist/ScopeRegistry-D1owDNSm.d.cts +61 -0
- package/dist/ScopeRegistry-D1owDNSm.d.ts +61 -0
- package/dist/ScopeRegistry.cjs +152 -0
- package/dist/ScopeRegistry.cjs.map +1 -0
- package/dist/ScopeRegistry.d.cts +2 -0
- package/dist/ScopeRegistry.d.ts +2 -0
- package/dist/ScopeRegistry.js +16 -0
- package/dist/ScopeRegistry.js.map +1 -0
- package/dist/State-CU50R26M.d.cts +19 -0
- package/dist/State-CU50R26M.d.ts +19 -0
- package/dist/State.cjs +19 -0
- package/dist/State.cjs.map +1 -0
- package/dist/State.d.cts +2 -0
- package/dist/State.d.ts +2 -0
- package/dist/State.js +2 -0
- package/dist/State.js.map +1 -0
- package/dist/StateTrait-BGsZghTz.d.ts +122 -0
- package/dist/StateTrait-OWhbj12c.d.cts +122 -0
- package/dist/StateTrait.cjs +2737 -0
- package/dist/StateTrait.cjs.map +1 -0
- package/dist/StateTrait.d.cts +9 -0
- package/dist/StateTrait.d.ts +9 -0
- package/dist/StateTrait.js +39 -0
- package/dist/StateTrait.js.map +1 -0
- package/dist/TraitLifecycle-CwV5WPFX.d.cts +88 -0
- package/dist/TraitLifecycle-LdIWmKlg.d.ts +88 -0
- package/dist/TraitLifecycle.cjs +581 -0
- package/dist/TraitLifecycle.cjs.map +1 -0
- package/dist/TraitLifecycle.d.cts +8 -0
- package/dist/TraitLifecycle.d.ts +8 -0
- package/dist/TraitLifecycle.js +24 -0
- package/dist/TraitLifecycle.js.map +1 -0
- package/dist/action-DiMDD_0v.d.cts +35 -0
- package/dist/action-DiMDD_0v.d.ts +35 -0
- package/dist/chunk-24VULZ7A.js +76 -0
- package/dist/chunk-24VULZ7A.js.map +1 -0
- package/dist/chunk-3IYZ5IGG.js +17 -0
- package/dist/chunk-3IYZ5IGG.js.map +1 -0
- package/dist/chunk-3QMIVH35.js +43 -0
- package/dist/chunk-3QMIVH35.js.map +1 -0
- package/dist/chunk-3RMKLXHX.js +83 -0
- package/dist/chunk-3RMKLXHX.js.map +1 -0
- package/dist/chunk-3TMODYZV.js +111 -0
- package/dist/chunk-3TMODYZV.js.map +1 -0
- package/dist/chunk-3VG5TWQR.js +27 -0
- package/dist/chunk-3VG5TWQR.js.map +1 -0
- package/dist/chunk-4CQAV7YB.js +37 -0
- package/dist/chunk-4CQAV7YB.js.map +1 -0
- package/dist/chunk-4SO6JMZL.js +7 -0
- package/dist/chunk-4SO6JMZL.js.map +1 -0
- package/dist/chunk-66ALHVEX.js +40 -0
- package/dist/chunk-66ALHVEX.js.map +1 -0
- package/dist/chunk-76WT3HOR.js +397 -0
- package/dist/chunk-76WT3HOR.js.map +1 -0
- package/dist/chunk-ANLBCBDC.js +285 -0
- package/dist/chunk-ANLBCBDC.js.map +1 -0
- package/dist/chunk-AUIR5O6W.js +75 -0
- package/dist/chunk-AUIR5O6W.js.map +1 -0
- package/dist/chunk-BABLDP24.js +445 -0
- package/dist/chunk-BABLDP24.js.map +1 -0
- package/dist/chunk-BE3HW4FY.js +1099 -0
- package/dist/chunk-BE3HW4FY.js.map +1 -0
- package/dist/chunk-BZ2SHDN2.js +54 -0
- package/dist/chunk-BZ2SHDN2.js.map +1 -0
- package/dist/chunk-CW6T36TN.js +393 -0
- package/dist/chunk-CW6T36TN.js.map +1 -0
- package/dist/chunk-DFNM3WX2.js +632 -0
- package/dist/chunk-DFNM3WX2.js.map +1 -0
- package/dist/chunk-DMBALCE2.js +1034 -0
- package/dist/chunk-DMBALCE2.js.map +1 -0
- package/dist/chunk-EGK3KN7B.js +406 -0
- package/dist/chunk-EGK3KN7B.js.map +1 -0
- package/dist/chunk-EY4NZKDR.js +19 -0
- package/dist/chunk-EY4NZKDR.js.map +1 -0
- package/dist/chunk-G5ZBFPNU.js +23 -0
- package/dist/chunk-G5ZBFPNU.js.map +1 -0
- package/dist/chunk-GMPEOUP2.js +31 -0
- package/dist/chunk-GMPEOUP2.js.map +1 -0
- package/dist/chunk-IHVBV5C2.js +279 -0
- package/dist/chunk-IHVBV5C2.js.map +1 -0
- package/dist/chunk-IPF7E66P.js +23 -0
- package/dist/chunk-IPF7E66P.js.map +1 -0
- package/dist/chunk-JCXGZRMU.js +204 -0
- package/dist/chunk-JCXGZRMU.js.map +1 -0
- package/dist/chunk-JGIWG6SR.js +6359 -0
- package/dist/chunk-JGIWG6SR.js.map +1 -0
- package/dist/chunk-JWOYLO27.js +241 -0
- package/dist/chunk-JWOYLO27.js.map +1 -0
- package/dist/chunk-KIXAU3GM.js +137 -0
- package/dist/chunk-KIXAU3GM.js.map +1 -0
- package/dist/chunk-KL5ACTCT.js +8 -0
- package/dist/chunk-KL5ACTCT.js.map +1 -0
- package/dist/chunk-KP7MUZNX.js +83 -0
- package/dist/chunk-KP7MUZNX.js.map +1 -0
- package/dist/chunk-LEU6UA5J.js +1 -0
- package/dist/chunk-LEU6UA5J.js.map +1 -0
- package/dist/chunk-M2RGJPXX.js +35 -0
- package/dist/chunk-M2RGJPXX.js.map +1 -0
- package/dist/chunk-M3BFQ7HK.js +13 -0
- package/dist/chunk-M3BFQ7HK.js.map +1 -0
- package/dist/chunk-M3WTHJHJ.js +1051 -0
- package/dist/chunk-M3WTHJHJ.js.map +1 -0
- package/dist/chunk-M7IYCTJV.js +79 -0
- package/dist/chunk-M7IYCTJV.js.map +1 -0
- package/dist/chunk-NBD3KUOZ.js +838 -0
- package/dist/chunk-NBD3KUOZ.js.map +1 -0
- package/dist/chunk-NQZ2OSGR.js +151 -0
- package/dist/chunk-NQZ2OSGR.js.map +1 -0
- package/dist/chunk-NZJKFF45.js +106 -0
- package/dist/chunk-NZJKFF45.js.map +1 -0
- package/dist/chunk-OFADUJWJ.js +175 -0
- package/dist/chunk-OFADUJWJ.js.map +1 -0
- package/dist/chunk-OGWBVHB3.js +461 -0
- package/dist/chunk-OGWBVHB3.js.map +1 -0
- package/dist/chunk-PAYXCY6A.js +1696 -0
- package/dist/chunk-PAYXCY6A.js.map +1 -0
- package/dist/chunk-PYOE4VSI.js +1924 -0
- package/dist/chunk-PYOE4VSI.js.map +1 -0
- package/dist/chunk-PZ5AY32C.js +10 -0
- package/dist/chunk-PZ5AY32C.js.map +1 -0
- package/dist/chunk-QCHIQWAJ.js +21 -0
- package/dist/chunk-QCHIQWAJ.js.map +1 -0
- package/dist/chunk-QMM6O4CD.js +71 -0
- package/dist/chunk-QMM6O4CD.js.map +1 -0
- package/dist/chunk-RNFE3ML2.js +22 -0
- package/dist/chunk-RNFE3ML2.js.map +1 -0
- package/dist/chunk-TAAPQVZN.js +23 -0
- package/dist/chunk-TAAPQVZN.js.map +1 -0
- package/dist/chunk-THATMZXD.js +21 -0
- package/dist/chunk-THATMZXD.js.map +1 -0
- package/dist/chunk-TKZ7MEIA.js +27 -0
- package/dist/chunk-TKZ7MEIA.js.map +1 -0
- package/dist/chunk-TQOBJYDP.js +7 -0
- package/dist/chunk-TQOBJYDP.js.map +1 -0
- package/dist/chunk-VZB726PE.js +93 -0
- package/dist/chunk-VZB726PE.js.map +1 -0
- package/dist/chunk-W3TEWHLO.js +568 -0
- package/dist/chunk-W3TEWHLO.js.map +1 -0
- package/dist/chunk-YS3AZQ2G.js +52 -0
- package/dist/chunk-YS3AZQ2G.js.map +1 -0
- package/dist/chunk-ZDTRWK5F.js +40 -0
- package/dist/chunk-ZDTRWK5F.js.map +1 -0
- package/dist/chunk-ZFLHVFUC.js +192 -0
- package/dist/chunk-ZFLHVFUC.js.map +1 -0
- package/dist/chunk-ZFY7U2FR.js +133 -0
- package/dist/chunk-ZFY7U2FR.js.map +1 -0
- package/dist/chunk-ZGDVUPTM.js +270 -0
- package/dist/chunk-ZGDVUPTM.js.map +1 -0
- package/dist/index.cjs +19700 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +195 -0
- package/dist/index.d.ts +195 -0
- package/dist/index.js +286 -0
- package/dist/index.js.map +1 -0
- package/dist/ir-BMP7yxJJ.d.cts +39 -0
- package/dist/ir-DUOz6H-5.d.ts +39 -0
- package/dist/module-B8CBqIZ_.d.cts +1191 -0
- package/dist/module-k7m3txak.d.ts +1191 -0
- package/dist/protocol-g_1897M2.d.cts +127 -0
- package/dist/protocol-g_1897M2.d.ts +127 -0
- package/package.json +162 -0
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import { h as AnyModuleShape, l as ModuleRuntime, o as StateOf, p as ActionOf, m as ModuleHandle, M as ModuleTag, k as ModuleImpl, A as AnySchema, z as ModuleLike, R as ReducersFromMap, j as ModuleLogic, B as BoundApi, O as ModuleImplementStateTransactionOptions, r as MutatorsFromMap, F as FieldPath, i as ModuleShape, q as ActionsFromMap, v as StateChangeWithMeta, u as StateCommitMeta, s as StateCommitMode, t as StateCommitPriority } from './module-B8CBqIZ_.cjs';
|
|
2
|
+
import { Context, Layer, Effect, Schema } from 'effect';
|
|
3
|
+
import { O as Of, D as Draft } from './Logic-DRh4sDZj.cjs';
|
|
4
|
+
import { b as ActionDefs, a as ActionToken, N as NormalizedActionTokens } from './action-DiMDD_0v.cjs';
|
|
5
|
+
|
|
6
|
+
interface DevSource {
|
|
7
|
+
readonly file: string;
|
|
8
|
+
readonly line: number;
|
|
9
|
+
readonly column: number;
|
|
10
|
+
}
|
|
11
|
+
interface ModuleDev {
|
|
12
|
+
readonly source?: DevSource;
|
|
13
|
+
}
|
|
14
|
+
interface LogicUnitOptions {
|
|
15
|
+
readonly id?: string;
|
|
16
|
+
readonly kind?: string;
|
|
17
|
+
readonly name?: string;
|
|
18
|
+
readonly source?: DevSource;
|
|
19
|
+
}
|
|
20
|
+
interface MountedLogicUnitSummary {
|
|
21
|
+
readonly kind: string;
|
|
22
|
+
readonly id: string;
|
|
23
|
+
readonly derived?: boolean;
|
|
24
|
+
readonly name?: string;
|
|
25
|
+
}
|
|
26
|
+
interface ModuleDescriptor {
|
|
27
|
+
readonly id: string;
|
|
28
|
+
readonly moduleId: string;
|
|
29
|
+
readonly instanceId: string;
|
|
30
|
+
readonly actionKeys: ReadonlyArray<string>;
|
|
31
|
+
readonly logicUnits: ReadonlyArray<MountedLogicUnitSummary>;
|
|
32
|
+
readonly schemaKeys?: ReadonlyArray<string>;
|
|
33
|
+
readonly meta?: Record<string, unknown>;
|
|
34
|
+
readonly source?: DevSource;
|
|
35
|
+
}
|
|
36
|
+
type HandleExtendFn<Sh extends AnyModuleShape, Ext extends object> = (runtime: ModuleRuntime<StateOf<Sh>, ActionOf<Sh>>, base: ModuleHandle<Sh>) => Ext | (ModuleHandle<Sh> & Ext) | null | undefined;
|
|
37
|
+
type NoInfer_<T> = [T][T extends any ? 0 : never];
|
|
38
|
+
type ModuleDefBase<Id extends string = string, Sh extends AnyModuleShape = AnyModuleShape, Ext extends object = {}> = ModuleLike<Id, Sh, Ext> & {
|
|
39
|
+
readonly shape: Sh;
|
|
40
|
+
readonly stateSchema: Sh['stateSchema'];
|
|
41
|
+
readonly actionSchema: Sh['actionSchema'];
|
|
42
|
+
/**
|
|
43
|
+
* Raw ActionMap (tag -> payload schema).
|
|
44
|
+
* - Mainly for DX/reflection; runtime contract is still based on tag.shape/actionSchema.
|
|
45
|
+
*/
|
|
46
|
+
readonly actions: Sh['actionMap'];
|
|
47
|
+
/**
|
|
48
|
+
* Raw reducers (if provided by the definition).
|
|
49
|
+
* - Mainly for DX/reflection; runtime normalizes them into primary reducers inside ModuleTag/ModuleFactory.
|
|
50
|
+
*/
|
|
51
|
+
readonly reducers?: ReducersFromMap<Sh['stateSchema'], Sh['actionMap']>;
|
|
52
|
+
readonly live: <R = never, E = never>(initial: StateOf<Sh>, ...logics: Array<ModuleLogic<Sh, R, E>>) => Layer.Layer<ModuleRuntime<StateOf<Sh>, ActionOf<Sh>>, E, R>;
|
|
53
|
+
readonly schemas?: Record<string, unknown>;
|
|
54
|
+
readonly meta?: Record<string, unknown>;
|
|
55
|
+
readonly services?: Record<string, Context.Tag<any, any>>;
|
|
56
|
+
readonly dev?: ModuleDev;
|
|
57
|
+
readonly logic: <R = never, E = unknown>(build: (api: BoundApi<Sh, R> & {
|
|
58
|
+
readonly self: Of<Sh, R, ModuleHandle<Sh> & Ext, never>;
|
|
59
|
+
}) => ModuleLogic<Sh, R, E>, options?: LogicUnitOptions) => ModuleLogic<Sh, R, E>;
|
|
60
|
+
};
|
|
61
|
+
type AnyModule = {
|
|
62
|
+
readonly _kind: 'Module';
|
|
63
|
+
readonly id: string;
|
|
64
|
+
readonly tag: ModuleTag<string, AnyModuleShape>;
|
|
65
|
+
readonly impl: ModuleImpl<any, AnyModuleShape, any>;
|
|
66
|
+
readonly actions: Record<string, AnySchema>;
|
|
67
|
+
readonly reducers?: Record<string, unknown>;
|
|
68
|
+
readonly schemas?: Record<string, unknown>;
|
|
69
|
+
readonly meta?: Record<string, unknown>;
|
|
70
|
+
readonly services?: Record<string, Context.Tag<any, any>>;
|
|
71
|
+
readonly dev?: ModuleDev;
|
|
72
|
+
};
|
|
73
|
+
type Module<Id extends string, Sh extends AnyModuleShape, Ext extends object = {}, R = never> = ModuleDefBase<Id, Sh, Ext> & {
|
|
74
|
+
readonly _kind: 'Module';
|
|
75
|
+
readonly impl: ModuleImpl<Id, Sh, R>;
|
|
76
|
+
readonly withLogic: (logic: ModuleLogic<Sh, any, any>, options?: LogicUnitOptions) => Module<Id, Sh, Ext, R>;
|
|
77
|
+
readonly withLogics: (...inputs: ReadonlyArray<MountInput<Sh>>) => Module<Id, Sh, Ext, R>;
|
|
78
|
+
readonly withLayer: (layer: Layer.Layer<any, never, any>) => Module<Id, Sh, Ext, R>;
|
|
79
|
+
readonly withLayers: (...layers: ReadonlyArray<Layer.Layer<any, never, any>>) => Module<Id, Sh, Ext, R>;
|
|
80
|
+
};
|
|
81
|
+
type ModuleDef<Id extends string, Sh extends AnyModuleShape, Ext extends object = {}> = ModuleDefBase<Id, Sh, Ext> & {
|
|
82
|
+
readonly _kind: 'ModuleDef';
|
|
83
|
+
readonly implement: <R = never>(config: {
|
|
84
|
+
readonly initial: StateOf<Sh>;
|
|
85
|
+
readonly logics?: Array<ModuleLogic<Sh, R, any>>;
|
|
86
|
+
readonly imports?: ReadonlyArray<Layer.Layer<any, any, any> | ModuleImpl<any, AnyModuleShape, any>>;
|
|
87
|
+
readonly processes?: ReadonlyArray<Effect.Effect<void, any, any>>;
|
|
88
|
+
readonly stateTransaction?: ModuleImplementStateTransactionOptions;
|
|
89
|
+
}) => Module<Id, Sh, Ext, R>;
|
|
90
|
+
};
|
|
91
|
+
declare const is: (value: unknown) => value is ModuleDefBase;
|
|
92
|
+
declare const hasImpl: (value: unknown) => value is AnyModule;
|
|
93
|
+
declare const unwrapTag: <Id extends string, Sh extends AnyModuleShape>(module: ModuleLike<Id, Sh, any>) => ModuleTag<Id, Sh>;
|
|
94
|
+
declare const unwrapImpl: <Id extends string, Sh extends AnyModuleShape>(module: AnyModule & {
|
|
95
|
+
readonly id: Id;
|
|
96
|
+
readonly tag: ModuleTag<Id, Sh>;
|
|
97
|
+
}) => ModuleImpl<Id, Sh, any>;
|
|
98
|
+
declare const descriptor: (module: ModuleDefBase<string, AnyModuleShape, any>, runtime: ModuleRuntime<any, any>) => ModuleDescriptor;
|
|
99
|
+
type MountInput<Sh extends AnyModuleShape> = ModuleLogic<Sh, any, any> | readonly [ModuleLogic<Sh, any, any>, LogicUnitOptions];
|
|
100
|
+
type MakeDef<Id extends string, SSchema extends AnySchema, AMap extends ActionDefs> = {
|
|
101
|
+
readonly state: SSchema;
|
|
102
|
+
readonly actions: AMap;
|
|
103
|
+
readonly reducers?: ReducersFromMap<SSchema, NoInfer_<AMap>>;
|
|
104
|
+
readonly immerReducers?: MutatorsFromMap<SSchema, NoInfer_<AMap>>;
|
|
105
|
+
readonly effects?: EffectsFromMap<NoInfer_<AMap>>;
|
|
106
|
+
readonly traits?: unknown;
|
|
107
|
+
readonly schemas?: Record<string, unknown>;
|
|
108
|
+
readonly meta?: Record<string, unknown>;
|
|
109
|
+
readonly services?: Record<string, Context.Tag<any, any>>;
|
|
110
|
+
readonly dev?: ModuleDev;
|
|
111
|
+
};
|
|
112
|
+
type AnyActionMap = ActionDefs;
|
|
113
|
+
type EmptyActionMap = Record<never, never>;
|
|
114
|
+
type PayloadOfActionDef<V> = V extends Schema.Schema<any, any, any> ? Schema.Schema.Type<V> : V extends ActionToken<any, infer P, any> ? P : never;
|
|
115
|
+
type DeclaredEffectHandler<Payload> = ($: unknown, payload: Payload) => Effect.Effect<void, any, any>;
|
|
116
|
+
type EffectsFromMap<M extends AnyActionMap> = {
|
|
117
|
+
readonly [K in keyof M]?: ReadonlyArray<DeclaredEffectHandler<PayloadOfActionDef<M[K]>>>;
|
|
118
|
+
};
|
|
119
|
+
type MergeActionMap<Base extends AnyActionMap, Ext extends AnyActionMap> = {
|
|
120
|
+
readonly [K in keyof Base | keyof Ext]: K extends keyof Ext ? Ext[K] : K extends keyof Base ? Base[K] : never;
|
|
121
|
+
};
|
|
122
|
+
/**
|
|
123
|
+
* Module.make "app-side extension/override" parameters (a two-stage responsibility split: domain library author → app developer).
|
|
124
|
+
*
|
|
125
|
+
* - `actions`: add-only (cannot override existing action schema); used to extend actionMap.
|
|
126
|
+
* - `reducers`: add and override; used to override domain reducers or provide reducers for new actions.
|
|
127
|
+
* - Other reflective fields (schemas/meta/services/dev) are shallow-merged (last-write-wins).
|
|
128
|
+
*/
|
|
129
|
+
type MakeExtendDef<SSchema extends AnySchema, BaseActions extends AnyActionMap, ExtActions extends AnyActionMap = EmptyActionMap> = {
|
|
130
|
+
readonly actions?: ExtActions;
|
|
131
|
+
readonly reducers?: ReducersFromMap<SSchema, MergeActionMap<BaseActions, ExtActions>>;
|
|
132
|
+
readonly immerReducers?: MutatorsFromMap<SSchema, MergeActionMap<BaseActions, ExtActions>>;
|
|
133
|
+
readonly effects?: EffectsFromMap<MergeActionMap<BaseActions, ExtActions>>;
|
|
134
|
+
readonly schemas?: Record<string, unknown>;
|
|
135
|
+
readonly meta?: Record<string, unknown>;
|
|
136
|
+
readonly services?: Record<string, Context.Tag<any, any>>;
|
|
137
|
+
readonly dev?: ModuleDev;
|
|
138
|
+
};
|
|
139
|
+
declare const Reducer: {
|
|
140
|
+
mutate: <S, A extends {
|
|
141
|
+
readonly payload?: any;
|
|
142
|
+
}>(mutator: (draft: Draft<S>, payload: A["payload"]) => void) => ((state: S, action: A, sink?: (path: string | FieldPath) => void) => S);
|
|
143
|
+
mutateMap: <R extends Readonly<Record<string, ((state: any, action: any, sink?: (path: string | FieldPath) => void) => any) | undefined>>>(mutators: { readonly [K in keyof [R][R extends any ? 0 : never]]?: (draft: Draft<Parameters<NonNullable<[R][R extends any ? 0 : never][K]>>[0]>, payload: Parameters<NonNullable<[R][R extends any ? 0 : never][K]>>[1] extends {
|
|
144
|
+
readonly payload: infer P;
|
|
145
|
+
} ? P : Parameters<NonNullable<[R][R extends any ? 0 : never][K]>>[1] extends {
|
|
146
|
+
readonly payload?: infer P;
|
|
147
|
+
} ? P | undefined : never) => void; }) => R;
|
|
148
|
+
};
|
|
149
|
+
type Shape<S extends AnySchema, M extends ActionDefs> = ModuleShape<S, Schema.Schema<ActionsFromMap<NormalizedActionTokens<M>>>, NormalizedActionTokens<M>>;
|
|
150
|
+
declare function make<Id extends string, SSchema extends AnySchema, AMap extends ActionDefs, Ext extends object = {}>(id: Id, def: MakeDef<Id, SSchema, AMap>): ModuleDef<Id, ModuleShape<SSchema, Schema.Schema<ActionsFromMap<NormalizedActionTokens<AMap>>>, NormalizedActionTokens<AMap>>, Ext>;
|
|
151
|
+
declare function make<Id extends string, SSchema extends AnySchema, AMap extends ActionDefs, Ext extends object = {}, ExtActions extends ActionDefs = EmptyActionMap>(id: Id, def: MakeDef<Id, SSchema, AMap>, extend: MakeExtendDef<SSchema, NoInfer_<AMap>, ExtActions>): ModuleDef<Id, ModuleShape<SSchema, Schema.Schema<ActionsFromMap<NormalizedActionTokens<MergeActionMap<AMap, ExtActions>>>>, NormalizedActionTokens<MergeActionMap<AMap, ExtActions>>>, Ext>;
|
|
152
|
+
declare const Manage: {
|
|
153
|
+
readonly make: <D extends (...args: any[]) => AnyModule>(config: {
|
|
154
|
+
readonly kind?: string;
|
|
155
|
+
readonly define: D;
|
|
156
|
+
}) => {
|
|
157
|
+
readonly kind?: string;
|
|
158
|
+
readonly make: D;
|
|
159
|
+
};
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
declare const Module$1_ActionOf: typeof ActionOf;
|
|
163
|
+
declare const Module$1_ActionsFromMap: typeof ActionsFromMap;
|
|
164
|
+
type Module$1_AnyModule = AnyModule;
|
|
165
|
+
declare const Module$1_AnyModuleShape: typeof AnyModuleShape;
|
|
166
|
+
declare const Module$1_AnySchema: typeof AnySchema;
|
|
167
|
+
declare const Module$1_BoundApi: typeof BoundApi;
|
|
168
|
+
type Module$1_DevSource = DevSource;
|
|
169
|
+
type Module$1_HandleExtendFn<Sh extends AnyModuleShape, Ext extends object> = HandleExtendFn<Sh, Ext>;
|
|
170
|
+
type Module$1_LogicUnitOptions = LogicUnitOptions;
|
|
171
|
+
type Module$1_MakeExtendDef<SSchema extends AnySchema, BaseActions extends AnyActionMap, ExtActions extends AnyActionMap = EmptyActionMap> = MakeExtendDef<SSchema, BaseActions, ExtActions>;
|
|
172
|
+
declare const Module$1_Manage: typeof Manage;
|
|
173
|
+
type Module$1_Module<Id extends string, Sh extends AnyModuleShape, Ext extends object = {}, R = never> = Module<Id, Sh, Ext, R>;
|
|
174
|
+
type Module$1_ModuleDef<Id extends string, Sh extends AnyModuleShape, Ext extends object = {}> = ModuleDef<Id, Sh, Ext>;
|
|
175
|
+
type Module$1_ModuleDescriptor = ModuleDescriptor;
|
|
176
|
+
type Module$1_ModuleDev = ModuleDev;
|
|
177
|
+
declare const Module$1_ModuleHandle: typeof ModuleHandle;
|
|
178
|
+
declare const Module$1_ModuleImpl: typeof ModuleImpl;
|
|
179
|
+
declare const Module$1_ModuleLogic: typeof ModuleLogic;
|
|
180
|
+
declare const Module$1_ModuleRuntime: typeof ModuleRuntime;
|
|
181
|
+
declare const Module$1_ModuleShape: typeof ModuleShape;
|
|
182
|
+
declare const Module$1_ModuleTag: typeof ModuleTag;
|
|
183
|
+
type Module$1_MountedLogicUnitSummary = MountedLogicUnitSummary;
|
|
184
|
+
declare const Module$1_MutatorsFromMap: typeof MutatorsFromMap;
|
|
185
|
+
declare const Module$1_Reducer: typeof Reducer;
|
|
186
|
+
declare const Module$1_ReducersFromMap: typeof ReducersFromMap;
|
|
187
|
+
type Module$1_Shape<S extends AnySchema, M extends ActionDefs> = Shape<S, M>;
|
|
188
|
+
declare const Module$1_StateChangeWithMeta: typeof StateChangeWithMeta;
|
|
189
|
+
declare const Module$1_StateCommitMeta: typeof StateCommitMeta;
|
|
190
|
+
declare const Module$1_StateCommitMode: typeof StateCommitMode;
|
|
191
|
+
declare const Module$1_StateCommitPriority: typeof StateCommitPriority;
|
|
192
|
+
declare const Module$1_StateOf: typeof StateOf;
|
|
193
|
+
declare const Module$1_descriptor: typeof descriptor;
|
|
194
|
+
declare const Module$1_hasImpl: typeof hasImpl;
|
|
195
|
+
declare const Module$1_is: typeof is;
|
|
196
|
+
declare const Module$1_make: typeof make;
|
|
197
|
+
declare const Module$1_unwrapImpl: typeof unwrapImpl;
|
|
198
|
+
declare const Module$1_unwrapTag: typeof unwrapTag;
|
|
199
|
+
declare namespace Module$1 {
|
|
200
|
+
export { Module$1_ActionOf as ActionOf, Module$1_ActionsFromMap as ActionsFromMap, type Module$1_AnyModule as AnyModule, Module$1_AnyModuleShape as AnyModuleShape, Module$1_AnySchema as AnySchema, Module$1_BoundApi as BoundApi, type Module$1_DevSource as DevSource, type Module$1_HandleExtendFn as HandleExtendFn, type Module$1_LogicUnitOptions as LogicUnitOptions, type Module$1_MakeExtendDef as MakeExtendDef, Module$1_Manage as Manage, type Module$1_Module as Module, type Module$1_ModuleDef as ModuleDef, type Module$1_ModuleDescriptor as ModuleDescriptor, type Module$1_ModuleDev as ModuleDev, Module$1_ModuleHandle as ModuleHandle, Module$1_ModuleImpl as ModuleImpl, Module$1_ModuleLogic as ModuleLogic, Module$1_ModuleRuntime as ModuleRuntime, Module$1_ModuleShape as ModuleShape, Module$1_ModuleTag as ModuleTag, type Module$1_MountedLogicUnitSummary as MountedLogicUnitSummary, Module$1_MutatorsFromMap as MutatorsFromMap, Module$1_Reducer as Reducer, Module$1_ReducersFromMap as ReducersFromMap, type Module$1_Shape as Shape, Module$1_StateChangeWithMeta as StateChangeWithMeta, Module$1_StateCommitMeta as StateCommitMeta, Module$1_StateCommitMode as StateCommitMode, Module$1_StateCommitPriority as StateCommitPriority, Module$1_StateOf as StateOf, Module$1_descriptor as descriptor, Module$1_hasImpl as hasImpl, Module$1_is as is, Module$1_make as make, Module$1_unwrapImpl as unwrapImpl, Module$1_unwrapTag as unwrapTag };
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
export { type AnyModule as A, type DevSource as D, type HandleExtendFn as H, type LogicUnitOptions as L, Module$1 as M, Reducer as R, type Shape as S, type ModuleDev as a, type MountedLogicUnitSummary as b, type ModuleDescriptor as c, type ModuleDef as d, unwrapImpl as e, descriptor as f, type MakeExtendDef as g, hasImpl as h, is as i, Manage as j, type Module as k, make as m, unwrapTag as u };
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import { h as AnyModuleShape, l as ModuleRuntime, o as StateOf, p as ActionOf, m as ModuleHandle, M as ModuleTag, k as ModuleImpl, A as AnySchema, z as ModuleLike, R as ReducersFromMap, j as ModuleLogic, B as BoundApi, O as ModuleImplementStateTransactionOptions, r as MutatorsFromMap, F as FieldPath, i as ModuleShape, q as ActionsFromMap, v as StateChangeWithMeta, u as StateCommitMeta, s as StateCommitMode, t as StateCommitPriority } from './module-k7m3txak.js';
|
|
2
|
+
import { Context, Layer, Effect, Schema } from 'effect';
|
|
3
|
+
import { O as Of, D as Draft } from './Logic-BRjEMr-W.js';
|
|
4
|
+
import { b as ActionDefs, a as ActionToken, N as NormalizedActionTokens } from './action-DiMDD_0v.js';
|
|
5
|
+
|
|
6
|
+
interface DevSource {
|
|
7
|
+
readonly file: string;
|
|
8
|
+
readonly line: number;
|
|
9
|
+
readonly column: number;
|
|
10
|
+
}
|
|
11
|
+
interface ModuleDev {
|
|
12
|
+
readonly source?: DevSource;
|
|
13
|
+
}
|
|
14
|
+
interface LogicUnitOptions {
|
|
15
|
+
readonly id?: string;
|
|
16
|
+
readonly kind?: string;
|
|
17
|
+
readonly name?: string;
|
|
18
|
+
readonly source?: DevSource;
|
|
19
|
+
}
|
|
20
|
+
interface MountedLogicUnitSummary {
|
|
21
|
+
readonly kind: string;
|
|
22
|
+
readonly id: string;
|
|
23
|
+
readonly derived?: boolean;
|
|
24
|
+
readonly name?: string;
|
|
25
|
+
}
|
|
26
|
+
interface ModuleDescriptor {
|
|
27
|
+
readonly id: string;
|
|
28
|
+
readonly moduleId: string;
|
|
29
|
+
readonly instanceId: string;
|
|
30
|
+
readonly actionKeys: ReadonlyArray<string>;
|
|
31
|
+
readonly logicUnits: ReadonlyArray<MountedLogicUnitSummary>;
|
|
32
|
+
readonly schemaKeys?: ReadonlyArray<string>;
|
|
33
|
+
readonly meta?: Record<string, unknown>;
|
|
34
|
+
readonly source?: DevSource;
|
|
35
|
+
}
|
|
36
|
+
type HandleExtendFn<Sh extends AnyModuleShape, Ext extends object> = (runtime: ModuleRuntime<StateOf<Sh>, ActionOf<Sh>>, base: ModuleHandle<Sh>) => Ext | (ModuleHandle<Sh> & Ext) | null | undefined;
|
|
37
|
+
type NoInfer_<T> = [T][T extends any ? 0 : never];
|
|
38
|
+
type ModuleDefBase<Id extends string = string, Sh extends AnyModuleShape = AnyModuleShape, Ext extends object = {}> = ModuleLike<Id, Sh, Ext> & {
|
|
39
|
+
readonly shape: Sh;
|
|
40
|
+
readonly stateSchema: Sh['stateSchema'];
|
|
41
|
+
readonly actionSchema: Sh['actionSchema'];
|
|
42
|
+
/**
|
|
43
|
+
* Raw ActionMap (tag -> payload schema).
|
|
44
|
+
* - Mainly for DX/reflection; runtime contract is still based on tag.shape/actionSchema.
|
|
45
|
+
*/
|
|
46
|
+
readonly actions: Sh['actionMap'];
|
|
47
|
+
/**
|
|
48
|
+
* Raw reducers (if provided by the definition).
|
|
49
|
+
* - Mainly for DX/reflection; runtime normalizes them into primary reducers inside ModuleTag/ModuleFactory.
|
|
50
|
+
*/
|
|
51
|
+
readonly reducers?: ReducersFromMap<Sh['stateSchema'], Sh['actionMap']>;
|
|
52
|
+
readonly live: <R = never, E = never>(initial: StateOf<Sh>, ...logics: Array<ModuleLogic<Sh, R, E>>) => Layer.Layer<ModuleRuntime<StateOf<Sh>, ActionOf<Sh>>, E, R>;
|
|
53
|
+
readonly schemas?: Record<string, unknown>;
|
|
54
|
+
readonly meta?: Record<string, unknown>;
|
|
55
|
+
readonly services?: Record<string, Context.Tag<any, any>>;
|
|
56
|
+
readonly dev?: ModuleDev;
|
|
57
|
+
readonly logic: <R = never, E = unknown>(build: (api: BoundApi<Sh, R> & {
|
|
58
|
+
readonly self: Of<Sh, R, ModuleHandle<Sh> & Ext, never>;
|
|
59
|
+
}) => ModuleLogic<Sh, R, E>, options?: LogicUnitOptions) => ModuleLogic<Sh, R, E>;
|
|
60
|
+
};
|
|
61
|
+
type AnyModule = {
|
|
62
|
+
readonly _kind: 'Module';
|
|
63
|
+
readonly id: string;
|
|
64
|
+
readonly tag: ModuleTag<string, AnyModuleShape>;
|
|
65
|
+
readonly impl: ModuleImpl<any, AnyModuleShape, any>;
|
|
66
|
+
readonly actions: Record<string, AnySchema>;
|
|
67
|
+
readonly reducers?: Record<string, unknown>;
|
|
68
|
+
readonly schemas?: Record<string, unknown>;
|
|
69
|
+
readonly meta?: Record<string, unknown>;
|
|
70
|
+
readonly services?: Record<string, Context.Tag<any, any>>;
|
|
71
|
+
readonly dev?: ModuleDev;
|
|
72
|
+
};
|
|
73
|
+
type Module<Id extends string, Sh extends AnyModuleShape, Ext extends object = {}, R = never> = ModuleDefBase<Id, Sh, Ext> & {
|
|
74
|
+
readonly _kind: 'Module';
|
|
75
|
+
readonly impl: ModuleImpl<Id, Sh, R>;
|
|
76
|
+
readonly withLogic: (logic: ModuleLogic<Sh, any, any>, options?: LogicUnitOptions) => Module<Id, Sh, Ext, R>;
|
|
77
|
+
readonly withLogics: (...inputs: ReadonlyArray<MountInput<Sh>>) => Module<Id, Sh, Ext, R>;
|
|
78
|
+
readonly withLayer: (layer: Layer.Layer<any, never, any>) => Module<Id, Sh, Ext, R>;
|
|
79
|
+
readonly withLayers: (...layers: ReadonlyArray<Layer.Layer<any, never, any>>) => Module<Id, Sh, Ext, R>;
|
|
80
|
+
};
|
|
81
|
+
type ModuleDef<Id extends string, Sh extends AnyModuleShape, Ext extends object = {}> = ModuleDefBase<Id, Sh, Ext> & {
|
|
82
|
+
readonly _kind: 'ModuleDef';
|
|
83
|
+
readonly implement: <R = never>(config: {
|
|
84
|
+
readonly initial: StateOf<Sh>;
|
|
85
|
+
readonly logics?: Array<ModuleLogic<Sh, R, any>>;
|
|
86
|
+
readonly imports?: ReadonlyArray<Layer.Layer<any, any, any> | ModuleImpl<any, AnyModuleShape, any>>;
|
|
87
|
+
readonly processes?: ReadonlyArray<Effect.Effect<void, any, any>>;
|
|
88
|
+
readonly stateTransaction?: ModuleImplementStateTransactionOptions;
|
|
89
|
+
}) => Module<Id, Sh, Ext, R>;
|
|
90
|
+
};
|
|
91
|
+
declare const is: (value: unknown) => value is ModuleDefBase;
|
|
92
|
+
declare const hasImpl: (value: unknown) => value is AnyModule;
|
|
93
|
+
declare const unwrapTag: <Id extends string, Sh extends AnyModuleShape>(module: ModuleLike<Id, Sh, any>) => ModuleTag<Id, Sh>;
|
|
94
|
+
declare const unwrapImpl: <Id extends string, Sh extends AnyModuleShape>(module: AnyModule & {
|
|
95
|
+
readonly id: Id;
|
|
96
|
+
readonly tag: ModuleTag<Id, Sh>;
|
|
97
|
+
}) => ModuleImpl<Id, Sh, any>;
|
|
98
|
+
declare const descriptor: (module: ModuleDefBase<string, AnyModuleShape, any>, runtime: ModuleRuntime<any, any>) => ModuleDescriptor;
|
|
99
|
+
type MountInput<Sh extends AnyModuleShape> = ModuleLogic<Sh, any, any> | readonly [ModuleLogic<Sh, any, any>, LogicUnitOptions];
|
|
100
|
+
type MakeDef<Id extends string, SSchema extends AnySchema, AMap extends ActionDefs> = {
|
|
101
|
+
readonly state: SSchema;
|
|
102
|
+
readonly actions: AMap;
|
|
103
|
+
readonly reducers?: ReducersFromMap<SSchema, NoInfer_<AMap>>;
|
|
104
|
+
readonly immerReducers?: MutatorsFromMap<SSchema, NoInfer_<AMap>>;
|
|
105
|
+
readonly effects?: EffectsFromMap<NoInfer_<AMap>>;
|
|
106
|
+
readonly traits?: unknown;
|
|
107
|
+
readonly schemas?: Record<string, unknown>;
|
|
108
|
+
readonly meta?: Record<string, unknown>;
|
|
109
|
+
readonly services?: Record<string, Context.Tag<any, any>>;
|
|
110
|
+
readonly dev?: ModuleDev;
|
|
111
|
+
};
|
|
112
|
+
type AnyActionMap = ActionDefs;
|
|
113
|
+
type EmptyActionMap = Record<never, never>;
|
|
114
|
+
type PayloadOfActionDef<V> = V extends Schema.Schema<any, any, any> ? Schema.Schema.Type<V> : V extends ActionToken<any, infer P, any> ? P : never;
|
|
115
|
+
type DeclaredEffectHandler<Payload> = ($: unknown, payload: Payload) => Effect.Effect<void, any, any>;
|
|
116
|
+
type EffectsFromMap<M extends AnyActionMap> = {
|
|
117
|
+
readonly [K in keyof M]?: ReadonlyArray<DeclaredEffectHandler<PayloadOfActionDef<M[K]>>>;
|
|
118
|
+
};
|
|
119
|
+
type MergeActionMap<Base extends AnyActionMap, Ext extends AnyActionMap> = {
|
|
120
|
+
readonly [K in keyof Base | keyof Ext]: K extends keyof Ext ? Ext[K] : K extends keyof Base ? Base[K] : never;
|
|
121
|
+
};
|
|
122
|
+
/**
|
|
123
|
+
* Module.make "app-side extension/override" parameters (a two-stage responsibility split: domain library author → app developer).
|
|
124
|
+
*
|
|
125
|
+
* - `actions`: add-only (cannot override existing action schema); used to extend actionMap.
|
|
126
|
+
* - `reducers`: add and override; used to override domain reducers or provide reducers for new actions.
|
|
127
|
+
* - Other reflective fields (schemas/meta/services/dev) are shallow-merged (last-write-wins).
|
|
128
|
+
*/
|
|
129
|
+
type MakeExtendDef<SSchema extends AnySchema, BaseActions extends AnyActionMap, ExtActions extends AnyActionMap = EmptyActionMap> = {
|
|
130
|
+
readonly actions?: ExtActions;
|
|
131
|
+
readonly reducers?: ReducersFromMap<SSchema, MergeActionMap<BaseActions, ExtActions>>;
|
|
132
|
+
readonly immerReducers?: MutatorsFromMap<SSchema, MergeActionMap<BaseActions, ExtActions>>;
|
|
133
|
+
readonly effects?: EffectsFromMap<MergeActionMap<BaseActions, ExtActions>>;
|
|
134
|
+
readonly schemas?: Record<string, unknown>;
|
|
135
|
+
readonly meta?: Record<string, unknown>;
|
|
136
|
+
readonly services?: Record<string, Context.Tag<any, any>>;
|
|
137
|
+
readonly dev?: ModuleDev;
|
|
138
|
+
};
|
|
139
|
+
declare const Reducer: {
|
|
140
|
+
mutate: <S, A extends {
|
|
141
|
+
readonly payload?: any;
|
|
142
|
+
}>(mutator: (draft: Draft<S>, payload: A["payload"]) => void) => ((state: S, action: A, sink?: (path: string | FieldPath) => void) => S);
|
|
143
|
+
mutateMap: <R extends Readonly<Record<string, ((state: any, action: any, sink?: (path: string | FieldPath) => void) => any) | undefined>>>(mutators: { readonly [K in keyof [R][R extends any ? 0 : never]]?: (draft: Draft<Parameters<NonNullable<[R][R extends any ? 0 : never][K]>>[0]>, payload: Parameters<NonNullable<[R][R extends any ? 0 : never][K]>>[1] extends {
|
|
144
|
+
readonly payload: infer P;
|
|
145
|
+
} ? P : Parameters<NonNullable<[R][R extends any ? 0 : never][K]>>[1] extends {
|
|
146
|
+
readonly payload?: infer P;
|
|
147
|
+
} ? P | undefined : never) => void; }) => R;
|
|
148
|
+
};
|
|
149
|
+
type Shape<S extends AnySchema, M extends ActionDefs> = ModuleShape<S, Schema.Schema<ActionsFromMap<NormalizedActionTokens<M>>>, NormalizedActionTokens<M>>;
|
|
150
|
+
declare function make<Id extends string, SSchema extends AnySchema, AMap extends ActionDefs, Ext extends object = {}>(id: Id, def: MakeDef<Id, SSchema, AMap>): ModuleDef<Id, ModuleShape<SSchema, Schema.Schema<ActionsFromMap<NormalizedActionTokens<AMap>>>, NormalizedActionTokens<AMap>>, Ext>;
|
|
151
|
+
declare function make<Id extends string, SSchema extends AnySchema, AMap extends ActionDefs, Ext extends object = {}, ExtActions extends ActionDefs = EmptyActionMap>(id: Id, def: MakeDef<Id, SSchema, AMap>, extend: MakeExtendDef<SSchema, NoInfer_<AMap>, ExtActions>): ModuleDef<Id, ModuleShape<SSchema, Schema.Schema<ActionsFromMap<NormalizedActionTokens<MergeActionMap<AMap, ExtActions>>>>, NormalizedActionTokens<MergeActionMap<AMap, ExtActions>>>, Ext>;
|
|
152
|
+
declare const Manage: {
|
|
153
|
+
readonly make: <D extends (...args: any[]) => AnyModule>(config: {
|
|
154
|
+
readonly kind?: string;
|
|
155
|
+
readonly define: D;
|
|
156
|
+
}) => {
|
|
157
|
+
readonly kind?: string;
|
|
158
|
+
readonly make: D;
|
|
159
|
+
};
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
declare const Module$1_ActionOf: typeof ActionOf;
|
|
163
|
+
declare const Module$1_ActionsFromMap: typeof ActionsFromMap;
|
|
164
|
+
type Module$1_AnyModule = AnyModule;
|
|
165
|
+
declare const Module$1_AnyModuleShape: typeof AnyModuleShape;
|
|
166
|
+
declare const Module$1_AnySchema: typeof AnySchema;
|
|
167
|
+
declare const Module$1_BoundApi: typeof BoundApi;
|
|
168
|
+
type Module$1_DevSource = DevSource;
|
|
169
|
+
type Module$1_HandleExtendFn<Sh extends AnyModuleShape, Ext extends object> = HandleExtendFn<Sh, Ext>;
|
|
170
|
+
type Module$1_LogicUnitOptions = LogicUnitOptions;
|
|
171
|
+
type Module$1_MakeExtendDef<SSchema extends AnySchema, BaseActions extends AnyActionMap, ExtActions extends AnyActionMap = EmptyActionMap> = MakeExtendDef<SSchema, BaseActions, ExtActions>;
|
|
172
|
+
declare const Module$1_Manage: typeof Manage;
|
|
173
|
+
type Module$1_Module<Id extends string, Sh extends AnyModuleShape, Ext extends object = {}, R = never> = Module<Id, Sh, Ext, R>;
|
|
174
|
+
type Module$1_ModuleDef<Id extends string, Sh extends AnyModuleShape, Ext extends object = {}> = ModuleDef<Id, Sh, Ext>;
|
|
175
|
+
type Module$1_ModuleDescriptor = ModuleDescriptor;
|
|
176
|
+
type Module$1_ModuleDev = ModuleDev;
|
|
177
|
+
declare const Module$1_ModuleHandle: typeof ModuleHandle;
|
|
178
|
+
declare const Module$1_ModuleImpl: typeof ModuleImpl;
|
|
179
|
+
declare const Module$1_ModuleLogic: typeof ModuleLogic;
|
|
180
|
+
declare const Module$1_ModuleRuntime: typeof ModuleRuntime;
|
|
181
|
+
declare const Module$1_ModuleShape: typeof ModuleShape;
|
|
182
|
+
declare const Module$1_ModuleTag: typeof ModuleTag;
|
|
183
|
+
type Module$1_MountedLogicUnitSummary = MountedLogicUnitSummary;
|
|
184
|
+
declare const Module$1_MutatorsFromMap: typeof MutatorsFromMap;
|
|
185
|
+
declare const Module$1_Reducer: typeof Reducer;
|
|
186
|
+
declare const Module$1_ReducersFromMap: typeof ReducersFromMap;
|
|
187
|
+
type Module$1_Shape<S extends AnySchema, M extends ActionDefs> = Shape<S, M>;
|
|
188
|
+
declare const Module$1_StateChangeWithMeta: typeof StateChangeWithMeta;
|
|
189
|
+
declare const Module$1_StateCommitMeta: typeof StateCommitMeta;
|
|
190
|
+
declare const Module$1_StateCommitMode: typeof StateCommitMode;
|
|
191
|
+
declare const Module$1_StateCommitPriority: typeof StateCommitPriority;
|
|
192
|
+
declare const Module$1_StateOf: typeof StateOf;
|
|
193
|
+
declare const Module$1_descriptor: typeof descriptor;
|
|
194
|
+
declare const Module$1_hasImpl: typeof hasImpl;
|
|
195
|
+
declare const Module$1_is: typeof is;
|
|
196
|
+
declare const Module$1_make: typeof make;
|
|
197
|
+
declare const Module$1_unwrapImpl: typeof unwrapImpl;
|
|
198
|
+
declare const Module$1_unwrapTag: typeof unwrapTag;
|
|
199
|
+
declare namespace Module$1 {
|
|
200
|
+
export { Module$1_ActionOf as ActionOf, Module$1_ActionsFromMap as ActionsFromMap, type Module$1_AnyModule as AnyModule, Module$1_AnyModuleShape as AnyModuleShape, Module$1_AnySchema as AnySchema, Module$1_BoundApi as BoundApi, type Module$1_DevSource as DevSource, type Module$1_HandleExtendFn as HandleExtendFn, type Module$1_LogicUnitOptions as LogicUnitOptions, type Module$1_MakeExtendDef as MakeExtendDef, Module$1_Manage as Manage, type Module$1_Module as Module, type Module$1_ModuleDef as ModuleDef, type Module$1_ModuleDescriptor as ModuleDescriptor, type Module$1_ModuleDev as ModuleDev, Module$1_ModuleHandle as ModuleHandle, Module$1_ModuleImpl as ModuleImpl, Module$1_ModuleLogic as ModuleLogic, Module$1_ModuleRuntime as ModuleRuntime, Module$1_ModuleShape as ModuleShape, Module$1_ModuleTag as ModuleTag, type Module$1_MountedLogicUnitSummary as MountedLogicUnitSummary, Module$1_MutatorsFromMap as MutatorsFromMap, Module$1_Reducer as Reducer, Module$1_ReducersFromMap as ReducersFromMap, type Module$1_Shape as Shape, Module$1_StateChangeWithMeta as StateChangeWithMeta, Module$1_StateCommitMeta as StateCommitMeta, Module$1_StateCommitMode as StateCommitMode, Module$1_StateCommitPriority as StateCommitPriority, Module$1_StateOf as StateOf, Module$1_descriptor as descriptor, Module$1_hasImpl as hasImpl, Module$1_is as is, Module$1_make as make, Module$1_unwrapImpl as unwrapImpl, Module$1_unwrapTag as unwrapTag };
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
export { type AnyModule as A, type DevSource as D, type HandleExtendFn as H, type LogicUnitOptions as L, Module$1 as M, Reducer as R, type Shape as S, type ModuleDev as a, type MountedLogicUnitSummary as b, type ModuleDescriptor as c, type ModuleDef as d, unwrapImpl as e, descriptor as f, type MakeExtendDef as g, hasImpl as h, is as i, Manage as j, type Module as k, make as m, unwrapTag as u };
|