@playfast/reform 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/README.md +64 -0
- package/dist/cjs/boundary/boundary.js +86 -0
- package/dist/cjs/calc/asyncCalc.js +128 -0
- package/dist/cjs/calc/asyncData.js +37 -0
- package/dist/cjs/calc/calc.js +58 -0
- package/dist/cjs/calc/calcFamily.js +127 -0
- package/dist/cjs/channel/channel.js +142 -0
- package/dist/cjs/compose/composition.js +50 -0
- package/dist/cjs/compose/host.js +8 -0
- package/dist/cjs/compose/props.js +14 -0
- package/dist/cjs/compose/provide.js +30 -0
- package/dist/cjs/compose/slot.js +27 -0
- package/dist/cjs/compose/ui.js +61 -0
- package/dist/cjs/definition/definition.js +46 -0
- package/dist/cjs/event/event.js +36 -0
- package/dist/cjs/event/eventGroup.js +7 -0
- package/dist/cjs/feature/feature.js +102 -0
- package/dist/cjs/index.js +116 -0
- package/dist/cjs/internal/capture.js +14 -0
- package/dist/cjs/internal/ctx.js +2 -0
- package/dist/cjs/internal/errors.js +62 -0
- package/dist/cjs/internal/inspect.js +36 -0
- package/dist/cjs/internal/queryDriver.js +138 -0
- package/dist/cjs/internal/reuse.js +71 -0
- package/dist/cjs/internal/scheduler.js +73 -0
- package/dist/cjs/internal/seeds.js +19 -0
- package/dist/cjs/internal/sources.js +61 -0
- package/dist/cjs/internal/store.js +77 -0
- package/dist/cjs/internal/track.js +22 -0
- package/dist/cjs/package.json +4 -0
- package/dist/cjs/procedure/procedure.js +52 -0
- package/dist/cjs/reducer/reducer.js +64 -0
- package/dist/cjs/remote/remoteState.js +307 -0
- package/dist/cjs/runtime/bus.js +25 -0
- package/dist/cjs/runtime/loop.js +119 -0
- package/dist/cjs/scene/scene.js +36 -0
- package/dist/cjs/state/state.js +47 -0
- package/dist/cjs/state/stateFamily.js +101 -0
- package/dist/cjs/state/stateGroup.js +47 -0
- package/dist/cjs/state/token.js +23 -0
- package/dist/cjs/ui/node.js +2 -0
- package/dist/cjs/ui/trigger.js +2 -0
- package/dist/dts/boundary/boundary.d.ts +72 -0
- package/dist/dts/boundary/boundary.d.ts.map +1 -0
- package/dist/dts/calc/asyncCalc.d.ts +91 -0
- package/dist/dts/calc/asyncCalc.d.ts.map +1 -0
- package/dist/dts/calc/asyncData.d.ts +55 -0
- package/dist/dts/calc/asyncData.d.ts.map +1 -0
- package/dist/dts/calc/calc.d.ts +57 -0
- package/dist/dts/calc/calc.d.ts.map +1 -0
- package/dist/dts/calc/calcFamily.d.ts +57 -0
- package/dist/dts/calc/calcFamily.d.ts.map +1 -0
- package/dist/dts/channel/channel.d.ts +115 -0
- package/dist/dts/channel/channel.d.ts.map +1 -0
- package/dist/dts/compose/composition.d.ts +72 -0
- package/dist/dts/compose/composition.d.ts.map +1 -0
- package/dist/dts/compose/host.d.ts +17 -0
- package/dist/dts/compose/host.d.ts.map +1 -0
- package/dist/dts/compose/props.d.ts +13 -0
- package/dist/dts/compose/props.d.ts.map +1 -0
- package/dist/dts/compose/provide.d.ts +22 -0
- package/dist/dts/compose/provide.d.ts.map +1 -0
- package/dist/dts/compose/slot.d.ts +49 -0
- package/dist/dts/compose/slot.d.ts.map +1 -0
- package/dist/dts/compose/ui.d.ts +50 -0
- package/dist/dts/compose/ui.d.ts.map +1 -0
- package/dist/dts/definition/definition.d.ts +33 -0
- package/dist/dts/definition/definition.d.ts.map +1 -0
- package/dist/dts/event/event.d.ts +33 -0
- package/dist/dts/event/event.d.ts.map +1 -0
- package/dist/dts/event/eventGroup.d.ts +9 -0
- package/dist/dts/event/eventGroup.d.ts.map +1 -0
- package/dist/dts/feature/feature.d.ts +220 -0
- package/dist/dts/feature/feature.d.ts.map +1 -0
- package/dist/dts/index.d.ts +43 -0
- package/dist/dts/index.d.ts.map +1 -0
- package/dist/dts/internal/capture.d.ts +28 -0
- package/dist/dts/internal/capture.d.ts.map +1 -0
- package/dist/dts/internal/ctx.d.ts +12 -0
- package/dist/dts/internal/ctx.d.ts.map +1 -0
- package/dist/dts/internal/errors.d.ts +69 -0
- package/dist/dts/internal/errors.d.ts.map +1 -0
- package/dist/dts/internal/inspect.d.ts +17 -0
- package/dist/dts/internal/inspect.d.ts.map +1 -0
- package/dist/dts/internal/queryDriver.d.ts +65 -0
- package/dist/dts/internal/queryDriver.d.ts.map +1 -0
- package/dist/dts/internal/reuse.d.ts +10 -0
- package/dist/dts/internal/reuse.d.ts.map +1 -0
- package/dist/dts/internal/scheduler.d.ts +47 -0
- package/dist/dts/internal/scheduler.d.ts.map +1 -0
- package/dist/dts/internal/seeds.d.ts +17 -0
- package/dist/dts/internal/seeds.d.ts.map +1 -0
- package/dist/dts/internal/sources.d.ts +39 -0
- package/dist/dts/internal/sources.d.ts.map +1 -0
- package/dist/dts/internal/store.d.ts +47 -0
- package/dist/dts/internal/store.d.ts.map +1 -0
- package/dist/dts/internal/track.d.ts +33 -0
- package/dist/dts/internal/track.d.ts.map +1 -0
- package/dist/dts/procedure/procedure.d.ts +40 -0
- package/dist/dts/procedure/procedure.d.ts.map +1 -0
- package/dist/dts/reducer/reducer.d.ts +44 -0
- package/dist/dts/reducer/reducer.d.ts.map +1 -0
- package/dist/dts/remote/remoteState.d.ts +119 -0
- package/dist/dts/remote/remoteState.d.ts.map +1 -0
- package/dist/dts/runtime/bus.d.ts +27 -0
- package/dist/dts/runtime/bus.d.ts.map +1 -0
- package/dist/dts/runtime/loop.d.ts +45 -0
- package/dist/dts/runtime/loop.d.ts.map +1 -0
- package/dist/dts/scene/scene.d.ts +44 -0
- package/dist/dts/scene/scene.d.ts.map +1 -0
- package/dist/dts/state/state.d.ts +37 -0
- package/dist/dts/state/state.d.ts.map +1 -0
- package/dist/dts/state/stateFamily.d.ts +79 -0
- package/dist/dts/state/stateFamily.d.ts.map +1 -0
- package/dist/dts/state/stateGroup.d.ts +36 -0
- package/dist/dts/state/stateGroup.d.ts.map +1 -0
- package/dist/dts/state/token.d.ts +30 -0
- package/dist/dts/state/token.d.ts.map +1 -0
- package/dist/dts/ui/node.d.ts +9 -0
- package/dist/dts/ui/node.d.ts.map +1 -0
- package/dist/dts/ui/trigger.d.ts +7 -0
- package/dist/dts/ui/trigger.d.ts.map +1 -0
- package/dist/esm/boundary/boundary.js +83 -0
- package/dist/esm/boundary/boundary.js.map +1 -0
- package/dist/esm/calc/asyncCalc.js +95 -0
- package/dist/esm/calc/asyncCalc.js.map +1 -0
- package/dist/esm/calc/asyncData.js +34 -0
- package/dist/esm/calc/asyncData.js.map +1 -0
- package/dist/esm/calc/calc.js +58 -0
- package/dist/esm/calc/calc.js.map +1 -0
- package/dist/esm/calc/calcFamily.js +124 -0
- package/dist/esm/calc/calcFamily.js.map +1 -0
- package/dist/esm/channel/channel.js +136 -0
- package/dist/esm/channel/channel.js.map +1 -0
- package/dist/esm/compose/composition.js +46 -0
- package/dist/esm/compose/composition.js.map +1 -0
- package/dist/esm/compose/host.js +5 -0
- package/dist/esm/compose/host.js.map +1 -0
- package/dist/esm/compose/props.js +11 -0
- package/dist/esm/compose/props.js.map +1 -0
- package/dist/esm/compose/provide.js +28 -0
- package/dist/esm/compose/provide.js.map +1 -0
- package/dist/esm/compose/slot.js +23 -0
- package/dist/esm/compose/slot.js.map +1 -0
- package/dist/esm/compose/ui.js +57 -0
- package/dist/esm/compose/ui.js.map +1 -0
- package/dist/esm/definition/definition.js +42 -0
- package/dist/esm/definition/definition.js.map +1 -0
- package/dist/esm/event/event.js +30 -0
- package/dist/esm/event/event.js.map +1 -0
- package/dist/esm/event/eventGroup.js +4 -0
- package/dist/esm/event/eventGroup.js.map +1 -0
- package/dist/esm/feature/feature.js +98 -0
- package/dist/esm/feature/feature.js.map +1 -0
- package/dist/esm/index.js +45 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/internal/capture.js +11 -0
- package/dist/esm/internal/capture.js.map +1 -0
- package/dist/esm/internal/ctx.js +2 -0
- package/dist/esm/internal/ctx.js.map +1 -0
- package/dist/esm/internal/errors.js +54 -0
- package/dist/esm/internal/errors.js.map +1 -0
- package/dist/esm/internal/inspect.js +32 -0
- package/dist/esm/internal/inspect.js.map +1 -0
- package/dist/esm/internal/queryDriver.js +134 -0
- package/dist/esm/internal/queryDriver.js.map +1 -0
- package/dist/esm/internal/reuse.js +68 -0
- package/dist/esm/internal/reuse.js.map +1 -0
- package/dist/esm/internal/scheduler.js +69 -0
- package/dist/esm/internal/scheduler.js.map +1 -0
- package/dist/esm/internal/seeds.js +17 -0
- package/dist/esm/internal/seeds.js.map +1 -0
- package/dist/esm/internal/sources.js +59 -0
- package/dist/esm/internal/sources.js.map +1 -0
- package/dist/esm/internal/store.js +73 -0
- package/dist/esm/internal/store.js.map +1 -0
- package/dist/esm/internal/track.js +18 -0
- package/dist/esm/internal/track.js.map +1 -0
- package/dist/esm/package.json +4 -0
- package/dist/esm/procedure/procedure.js +50 -0
- package/dist/esm/procedure/procedure.js.map +1 -0
- package/dist/esm/reducer/reducer.js +63 -0
- package/dist/esm/reducer/reducer.js.map +1 -0
- package/dist/esm/remote/remoteState.js +270 -0
- package/dist/esm/remote/remoteState.js.map +1 -0
- package/dist/esm/runtime/bus.js +20 -0
- package/dist/esm/runtime/bus.js.map +1 -0
- package/dist/esm/runtime/loop.js +116 -0
- package/dist/esm/runtime/loop.js.map +1 -0
- package/dist/esm/scene/scene.js +31 -0
- package/dist/esm/scene/scene.js.map +1 -0
- package/dist/esm/state/state.js +43 -0
- package/dist/esm/state/state.js.map +1 -0
- package/dist/esm/state/stateFamily.js +96 -0
- package/dist/esm/state/stateFamily.js.map +1 -0
- package/dist/esm/state/stateGroup.js +46 -0
- package/dist/esm/state/stateGroup.js.map +1 -0
- package/dist/esm/state/token.js +20 -0
- package/dist/esm/state/token.js.map +1 -0
- package/dist/esm/ui/node.js +2 -0
- package/dist/esm/ui/node.js.map +1 -0
- package/dist/esm/ui/trigger.js +2 -0
- package/dist/esm/ui/trigger.js.map +1 -0
- package/package.json +33 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export * as State from './state/state.js';
|
|
2
|
+
export * as StateGroup from './state/stateGroup.js';
|
|
3
|
+
export * as StateFamily from './state/stateFamily.js';
|
|
4
|
+
export { StateToken } from './state/token.js';
|
|
5
|
+
export type { AnySource, Source } from './state/token.js';
|
|
6
|
+
export * as Event from './event/event.js';
|
|
7
|
+
export type { EventOf } from './event/event.js';
|
|
8
|
+
export * as EventGroup from './event/eventGroup.js';
|
|
9
|
+
export * as Reducer from './reducer/reducer.js';
|
|
10
|
+
export * as Calc from './calc/calc.js';
|
|
11
|
+
export * as CalcFamily from './calc/calcFamily.js';
|
|
12
|
+
export * as AsyncCalc from './calc/asyncCalc.js';
|
|
13
|
+
export type { InputsObject, InputStores, InvalidateBy } from './internal/sources.js';
|
|
14
|
+
export { type AsyncData, type AsyncError, type AsyncIdle, type AsyncLoading, type AsyncSuccess, } from './calc/asyncData.js';
|
|
15
|
+
export * as RemoteState from './remote/remoteState.js';
|
|
16
|
+
export type { FailedIntent, PendingIntent, RemoteStateClass } from './remote/remoteState.js';
|
|
17
|
+
export * as Boundary from './boundary/boundary.js';
|
|
18
|
+
export type { BoundaryErrored, BoundaryPending, BoundaryReady, BoundaryState, } from './boundary/boundary.js';
|
|
19
|
+
export * as Procedure from './procedure/procedure.js';
|
|
20
|
+
export * as Channel from './channel/channel.js';
|
|
21
|
+
export * as Composition from './compose/composition.js';
|
|
22
|
+
export type { CompositionClass, CompositionService, RenderEnv, } from './compose/composition.js';
|
|
23
|
+
export { Props } from './compose/props.js';
|
|
24
|
+
export { isSlot, type Node, slot, type SlotClass, type SlotInstance, type SlotProps, SlotTypeId, } from './compose/slot.js';
|
|
25
|
+
export { CurrentSlots, type SlotHost } from './compose/host.js';
|
|
26
|
+
export * as Ui from './compose/ui.js';
|
|
27
|
+
export { isUi, type LogicView, ui, type UiClass, type UiContract, UiTypeId, type ViewImpl, } from './compose/ui.js';
|
|
28
|
+
export { provide } from './compose/provide.js';
|
|
29
|
+
export type { Trigger } from './ui/trigger.js';
|
|
30
|
+
export * as Feature from './feature/feature.js';
|
|
31
|
+
export { type EngineServices, type FailedProps, type FeatureBinding, FeatureBindingTypeId, type FeatureClass, type FeatureManifest, featureModule, type FeatureModule, isFeature, isFeatureBinding, lazyImport, type LoadedModule, mountFeature, type Placeholders, type ProvidedBy, type RequireCarrier, } from './feature/feature.js';
|
|
32
|
+
export { type SlotChild } from './compose/slot.js';
|
|
33
|
+
export { isScene, type MountedServices, type Scene, scene, seedScene } from './scene/scene.js';
|
|
34
|
+
export { Bus, type Envelope, type Priority, publish, type Tagged } from './runtime/bus.js';
|
|
35
|
+
export { Engine, type ReducerEntry, Reducers } from './runtime/loop.js';
|
|
36
|
+
export { type ChannelClass, type ChannelPolicy, type ChannelRuntime, Channels, type ProcedureEntry, Procedures, } from './channel/channel.js';
|
|
37
|
+
export { CurrentTracker, type Subscribable, type Tracker } from './internal/track.js';
|
|
38
|
+
export { CaptureSink, type CaptureSinkApi, type UiCapture } from './internal/capture.js';
|
|
39
|
+
export { AsyncReducer, DuplicateRegistration, FeatureLoadFailed, InvalidProvideTarget, SlotRenderingUnavailable, UnknownGroupState, } from './internal/errors.js';
|
|
40
|
+
export { defaultScheduler, makeScheduler, Notifications, notificationsLayer, type Scheduler, } from './internal/scheduler.js';
|
|
41
|
+
export type { Store } from './internal/store.js';
|
|
42
|
+
export type { FamilyStore } from './state/stateFamily.js';
|
|
43
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,eAAe,CAAA;AACtC,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAA;AAChD,OAAO,KAAK,WAAW,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,YAAY,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAEtD,OAAO,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AAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAA;AACrF,OAAO,EACL,YAAY,EACZ,qBAAqB,EACrB,iBAAiB,EACjB,oBAAoB,EACpB,wBAAwB,EACxB,iBAAiB,GAClB,MAAM,mBAAmB,CAAA;AAI1B,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,aAAa,EACb,kBAAkB,EAClB,KAAK,SAAS,GACf,MAAM,sBAAsB,CAAA;AAC7B,YAAY,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AAC7C,YAAY,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Context } from 'effect';
|
|
2
|
+
import type { Trigger } from '../ui/trigger.js';
|
|
3
|
+
/**
|
|
4
|
+
* A single rendered UI node's observable surface: which contract rendered, the
|
|
5
|
+
* props it received, and the event triggers it was handed. This is exactly what
|
|
6
|
+
* a headless inspector (the proof facade, the dev tool) needs — no DOM, no JSX.
|
|
7
|
+
*/
|
|
8
|
+
export interface UiCapture {
|
|
9
|
+
readonly name: string;
|
|
10
|
+
readonly props: unknown;
|
|
11
|
+
readonly events: Record<string, Trigger<unknown>>;
|
|
12
|
+
}
|
|
13
|
+
/** Where captured renders are reported, when a capturing host is present. */
|
|
14
|
+
export interface CaptureSinkApi {
|
|
15
|
+
record(capture: UiCapture): void;
|
|
16
|
+
}
|
|
17
|
+
declare const CaptureSink_base: Context.TagClass<CaptureSink, "reform/internal/CaptureSink", CaptureSinkApi>;
|
|
18
|
+
/**
|
|
19
|
+
* An OPTIONAL service. Core's `ui` read consults it via `serviceOption`: when a
|
|
20
|
+
* capturing host provides it (proofs, the dev tool), every resolved view reports
|
|
21
|
+
* its `(props, events)` before rendering, giving a faithful tree without
|
|
22
|
+
* replacing any presentation. Production never provides it, so nothing is
|
|
23
|
+
* recorded and there is no cost beyond one `serviceOption` lookup per render.
|
|
24
|
+
*/
|
|
25
|
+
export declare class CaptureSink extends CaptureSink_base {
|
|
26
|
+
}
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=capture.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capture.d.ts","sourceRoot":"","sources":["../../../src/internal/capture.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAA;AAChC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAE5C;;;;GAIG;AACH,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC,CAAA;CAClD;AAED,6EAA6E;AAC7E,MAAM,WAAW,cAAc;IAC7B,MAAM,CAAC,OAAO,EAAE,SAAS,GAAG,IAAI,CAAA;CACjC;;AAED;;;;;;GAMG;AACH,qBAAa,WAAY,SAAQ,gBAG9B;CAAG"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Effect } from 'effect';
|
|
2
|
+
import type { YieldWrap } from 'effect/Utils';
|
|
3
|
+
/**
|
|
4
|
+
* The context (`R`) a generator body requires, recovered from the effects it
|
|
5
|
+
* yields. Shared by `Composition.live` and `Procedure.live`, whose bodies are
|
|
6
|
+
* both `Generator`s whose requirements must surface as their layer's `RIn`.
|
|
7
|
+
*
|
|
8
|
+
* A body that never yields (`Eff = never`) requires nothing — guard that case
|
|
9
|
+
* first, or `infer R` resolves to `unknown` and leaks into the layer's `RIn`.
|
|
10
|
+
*/
|
|
11
|
+
export type Ctx<Eff> = [Eff] extends [never] ? never : [Eff] extends [YieldWrap<Effect.Effect<any, any, infer R>>] ? R : never;
|
|
12
|
+
//# sourceMappingURL=ctx.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ctx.d.ts","sourceRoot":"","sources":["../../../src/internal/ctx.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AACpC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAE7C;;;;;;;GAOG;AACH,MAAM,MAAM,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,GACxC,KAAK,GACL,CAAC,GAAG,CAAC,SAAS,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,GACzD,CAAC,GACD,KAAK,CAAA"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
declare const SlotRenderingUnavailable_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
2
|
+
readonly _tag: "reform/SlotRenderingUnavailable";
|
|
3
|
+
} & Readonly<A>;
|
|
4
|
+
/**
|
|
5
|
+
* Tagged errors for the framework's synchronous boundaries. Even when thrown
|
|
6
|
+
* (React render, layer build, reflection), an error carries a `_tag` and its
|
|
7
|
+
* structured fields — never a bare `Error` — so callers and tooling can match on
|
|
8
|
+
* it. `Data.TaggedError` subclasses are real `Error`s, so `throw` still works.
|
|
9
|
+
*/
|
|
10
|
+
/** A `<slots.X/>` was rendered without a render-target host to realize it. */
|
|
11
|
+
export declare class SlotRenderingUnavailable extends SlotRenderingUnavailable_base<{
|
|
12
|
+
readonly slot: string;
|
|
13
|
+
}> {
|
|
14
|
+
get message(): string;
|
|
15
|
+
}
|
|
16
|
+
declare const InvalidProvideTarget_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
17
|
+
readonly _tag: "reform/InvalidProvideTarget";
|
|
18
|
+
} & Readonly<A>;
|
|
19
|
+
/** `provide(target, …)` was handed something that is neither a ui contract nor a slot. */
|
|
20
|
+
export declare class InvalidProvideTarget extends InvalidProvideTarget_base<{}> {
|
|
21
|
+
get message(): string;
|
|
22
|
+
}
|
|
23
|
+
declare const UnknownGroupState_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
24
|
+
readonly _tag: "reform/UnknownGroupState";
|
|
25
|
+
} & Readonly<A>;
|
|
26
|
+
/** `StateGroup.select(group, name)` named a state the group does not contain. */
|
|
27
|
+
export declare class UnknownGroupState extends UnknownGroupState_base<{
|
|
28
|
+
readonly name: string;
|
|
29
|
+
}> {
|
|
30
|
+
get message(): string;
|
|
31
|
+
}
|
|
32
|
+
declare const FeatureLoadFailed_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
33
|
+
readonly _tag: "reform/FeatureLoadFailed";
|
|
34
|
+
} & Readonly<A>;
|
|
35
|
+
/**
|
|
36
|
+
* A lazy `Feature`'s `load` Effect failed — the dynamic `import()` rejected (a
|
|
37
|
+
* missing chunk, a network failure, a module-eval throw). Surfaced as a typed
|
|
38
|
+
* failure the host hands to the feature's `placeholder.failed`, never a bare
|
|
39
|
+
* rejection. `cause` is the original rejection value.
|
|
40
|
+
*/
|
|
41
|
+
export declare class FeatureLoadFailed extends FeatureLoadFailed_base<{
|
|
42
|
+
readonly cause: unknown;
|
|
43
|
+
}> {
|
|
44
|
+
get message(): string;
|
|
45
|
+
}
|
|
46
|
+
declare const AsyncReducer_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
47
|
+
readonly _tag: "reform/AsyncReducer";
|
|
48
|
+
} & Readonly<A>;
|
|
49
|
+
/** A reducer fold returned a thenable — folds must be pure synchronous writes. */
|
|
50
|
+
export declare class AsyncReducer extends AsyncReducer_base<{}> {
|
|
51
|
+
get message(): string;
|
|
52
|
+
}
|
|
53
|
+
declare const DuplicateRegistration_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
54
|
+
readonly _tag: "reform/DuplicateRegistration";
|
|
55
|
+
} & Readonly<A>;
|
|
56
|
+
/**
|
|
57
|
+
* Two distinct primitives were registered under one name into the same runtime —
|
|
58
|
+
* a silent footgun, since names key DI tags and channel lanes. Thrown for a
|
|
59
|
+
* channel name reused with a different policy (the second would otherwise be
|
|
60
|
+
* dropped). Reducer/procedure name clashes are warned (logged), not thrown.
|
|
61
|
+
*/
|
|
62
|
+
export declare class DuplicateRegistration extends DuplicateRegistration_base<{
|
|
63
|
+
readonly kind: string;
|
|
64
|
+
readonly name: string;
|
|
65
|
+
}> {
|
|
66
|
+
get message(): string;
|
|
67
|
+
}
|
|
68
|
+
export {};
|
|
69
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/internal/errors.ts"],"names":[],"mappings":";;;AAEA;;;;;GAKG;AAEH,8EAA8E;AAC9E,qBAAa,wBAAyB,SAAQ,8BAAoD;IAChG,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CACtB,CAAC;IACA,IAAa,OAAO,IAAI,MAAM,CAE7B;CACF;;;;AAED,0FAA0F;AAC1F,qBAAa,oBAAqB,SAAQ,0BAAgD,EAAE,CAAC;IAC3F,IAAa,OAAO,IAAI,MAAM,CAE7B;CACF;;;;AAED,iFAAiF;AACjF,qBAAa,iBAAkB,SAAQ,uBAA6C;IAClF,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CACtB,CAAC;IACA,IAAa,OAAO,IAAI,MAAM,CAE7B;CACF;;;;AAED;;;;;GAKG;AACH,qBAAa,iBAAkB,SAAQ,uBAA6C;IAClF,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;CACxB,CAAC;IACA,IAAa,OAAO,IAAI,MAAM,CAE7B;CACF;;;;AAED,kFAAkF;AAClF,qBAAa,YAAa,SAAQ,kBAAwC,EAAE,CAAC;IAC3E,IAAa,OAAO,IAAI,MAAM,CAE7B;CACF;;;;AAED;;;;;GAKG;AACH,qBAAa,qBAAsB,SAAQ,2BAAiD;IAC1F,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CACtB,CAAC;IACA,IAAa,OAAO,IAAI,MAAM,CAE7B;CACF"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type Inspectable, NodeInspectSymbol } from 'effect/Inspectable';
|
|
2
|
+
export { type Inspectable, NodeInspectSymbol };
|
|
3
|
+
/**
|
|
4
|
+
* The `Inspectable` trio built around a `toJSON`, so every reform value prints
|
|
5
|
+
* like an Effect value — `_id`-tagged JSON under `console.log`, Node's
|
|
6
|
+
* inspector, `JSON.stringify`, and `String(...)` — instead of `[object Object]`.
|
|
7
|
+
* Mirrors Effect's `BaseProto` / `Inspectable.Class` (`Inspectable.ts:170`).
|
|
8
|
+
*/
|
|
9
|
+
export declare const inspectable: (toJSON: () => unknown) => Inspectable;
|
|
10
|
+
/**
|
|
11
|
+
* Attach the `Inspectable` trio to an existing object as *non-enumerable* own
|
|
12
|
+
* properties (so they don't show up in `Object.keys`/`for…in` over a definition
|
|
13
|
+
* class). Used where the value is built by other means — the definition classes,
|
|
14
|
+
* whose statics are merged in separately.
|
|
15
|
+
*/
|
|
16
|
+
export declare const attachInspectable: <T extends object>(target: T, toJSON: () => unknown) => T;
|
|
17
|
+
//# sourceMappingURL=inspect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inspect.d.ts","sourceRoot":"","sources":["../../../src/internal/inspect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,WAAW,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAEhF,OAAO,EAAE,KAAK,WAAW,EAAE,iBAAiB,EAAE,CAAA;AAE9C;;;;;GAKG;AACH,eAAO,MAAM,WAAW,GAAI,QAAQ,MAAM,OAAO,KAAG,WAIlD,CAAA;AAEF;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,GAAI,CAAC,SAAS,MAAM,EAAE,QAAQ,CAAC,EAAE,QAAQ,MAAM,OAAO,KAAG,CAWtF,CAAA"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { Brand, Effect, Schema, type Scope } from 'effect';
|
|
2
|
+
import { type AnyAsyncData } from '../calc/asyncData.js';
|
|
3
|
+
import { type InputsObject, type InputStores, type InvalidateBy } from './sources.js';
|
|
4
|
+
import { type Store } from './store.js';
|
|
5
|
+
import { type AnySource } from '../state/token.js';
|
|
6
|
+
/** `Gated` (whether the `Idle` arm exists) is the inverse of `alwaysOn`. */
|
|
7
|
+
export type GatedOf<AlwaysOn extends boolean> = AlwaysOn extends true ? false : true;
|
|
8
|
+
/** The runtime gated flag for an `alwaysOn` config, typed as its `Gated` literal. */
|
|
9
|
+
export declare const gatedFlag: <AlwaysOn extends boolean>(alwaysOn: AlwaysOn | undefined) => GatedOf<AlwaysOn>;
|
|
10
|
+
export type Revision = number & Brand.Brand<'reform/Revision'>;
|
|
11
|
+
export declare const Revision: Brand.Brand.Constructor<Revision>;
|
|
12
|
+
export declare const RevisionSchema: Schema.Schema<Revision, number>;
|
|
13
|
+
export declare const revisionZero: Revision;
|
|
14
|
+
export declare const bumpRevision: (r: Revision) => Revision;
|
|
15
|
+
export interface QueryDriverOptions<Inputs extends ReadonlyArray<AnySource>, A, E, R> {
|
|
16
|
+
/** The owning definition's name — only for the defect log line. */
|
|
17
|
+
readonly name: string;
|
|
18
|
+
/** The owning primitive's kind label — only for the defect log line. */
|
|
19
|
+
readonly label: string;
|
|
20
|
+
/** Whether `disabled` is honored / the `Idle` arm can occur. */
|
|
21
|
+
readonly gated: boolean;
|
|
22
|
+
readonly inputs: Inputs;
|
|
23
|
+
readonly query: (inputs: InputsObject<Inputs>) => Effect.Effect<A, E, R>;
|
|
24
|
+
readonly invalidateBy?: InvalidateBy<Inputs> | undefined;
|
|
25
|
+
readonly disabled?: ((inputs: InputsObject<Inputs>) => boolean) | undefined;
|
|
26
|
+
readonly coalesce?: 'switch' | 'trailing' | undefined;
|
|
27
|
+
readonly reuse?: boolean | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* An extra key segment + wake source beyond the declared inputs — the hidden
|
|
30
|
+
* `invalidateOn` revision. Kept out of `wireSources` so the user's `query`
|
|
31
|
+
* and `invalidateBy` see exactly the declared inputs.
|
|
32
|
+
*/
|
|
33
|
+
readonly extraKey?: {
|
|
34
|
+
readonly read: () => unknown;
|
|
35
|
+
readonly subscribe: (listener: () => void) => () => void;
|
|
36
|
+
} | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* Fired when a run's `Success` value has landed in the store (same scheduler
|
|
39
|
+
* flush — never before the converged value is readable), with the run's
|
|
40
|
+
* generation. Not fired on `Error`, interrupt, or while disabled. The seam
|
|
41
|
+
* `RemoteState` settles pending intents through.
|
|
42
|
+
*/
|
|
43
|
+
readonly onSettled?: ((generation: number) => void) | undefined;
|
|
44
|
+
}
|
|
45
|
+
export interface QueryDriver<A, E> {
|
|
46
|
+
/** The lifecycle store (the full union — callers narrow to their arms). */
|
|
47
|
+
readonly store: Store<AnyAsyncData<A, E>>;
|
|
48
|
+
/**
|
|
49
|
+
* The highest generation requested so far (0 before the first kick).
|
|
50
|
+
* Generations are assigned when a run is REQUESTED (enqueued), so a waiter
|
|
51
|
+
* registered as `requested() + 1` is satisfied only by a run that began
|
|
52
|
+
* after registration — the settle-ordering rule `RemoteState` builds on.
|
|
53
|
+
*/
|
|
54
|
+
readonly requested: () => number;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Build the driver: store + subscription + request queue + run fiber, all owned
|
|
58
|
+
* by the ambient scope (callers run this under `Layer.scoped`). A change to an
|
|
59
|
+
* input re-runs the query latest-wins (a new run cancels the in-flight one; or,
|
|
60
|
+
* with `coalesce: 'trailing'`, lets it finish and runs one trailing refetch);
|
|
61
|
+
* while a re-run is in flight the last `Success`/`Error` is kept with
|
|
62
|
+
* `refetching: true`.
|
|
63
|
+
*/
|
|
64
|
+
export declare const makeQueryDriver: <Inputs extends ReadonlyArray<AnySource>, A, E, R>(options: QueryDriverOptions<Inputs, A, E, R>) => Effect.Effect<QueryDriver<A, E>, never, InputStores<Inputs> | R | Scope.Scope>;
|
|
65
|
+
//# sourceMappingURL=queryDriver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"queryDriver.d.ts","sourceRoot":"","sources":["../../../src/internal/queryDriver.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EAGL,MAAM,EAIN,MAAM,EACN,KAAK,KAAK,EAEX,MAAM,QAAQ,CAAA;AACf,OAAO,EAAE,KAAK,YAAY,EAAa,MAAM,mBAAmB,CAAA;AAGhE,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,YAAY,EAGlB,MAAM,WAAW,CAAA;AAClB,OAAO,EAAa,KAAK,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/C,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAQ/C,4EAA4E;AAC5E,MAAM,MAAM,OAAO,CAAC,QAAQ,SAAS,OAAO,IAAI,QAAQ,SAAS,IAAI,GAAG,KAAK,GAAG,IAAI,CAAA;AAEpF,qFAAqF;AACrF,eAAO,MAAM,SAAS,GAAI,QAAQ,SAAS,OAAO,EAAE,UAAU,QAAQ,GAAG,SAAS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,CAAC,IAAI,EAAE,MAAM,OAAO,CAAA;QAC5B,QAAQ,CAAC,SAAS,EAAE,CAAC,QAAQ,EAAE,MAAM,IAAI,KAAK,MAAM,IAAI,CAAA;KACzD,GACD,SAAS,CAAA;IACb;;;;;OAKG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,SAAS,CAAA;CAChE;AAED,MAAM,WAAW,WAAW,CAAC,CAAC,EAAE,CAAC;IAC/B,2EAA2E;IAC3E,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;IACzC;;;;;OAKG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,MAAM,CAAA;CACjC;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,GAAI,MAAM,SAAS,aAAa,CAAC,SAAS,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAC9E,SAAS,kBAAkB,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,KAC3C,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,KAAK,CA0I5E,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Substitute `previous` nodes into `next` wherever they are value-equal. The
|
|
3
|
+
* walker only ever returns `previous`, `next`, or a key/index-wise
|
|
4
|
+
* reconstruction of `next` whose every leaf came from one of them, so the
|
|
5
|
+
* result is value-equal to `next` and the type is preserved by construction —
|
|
6
|
+
* the single cast below is that argument, in the style of `wireSources` /
|
|
7
|
+
* `narrowStore`.
|
|
8
|
+
*/
|
|
9
|
+
export declare const reuse: <A>(previous: A, next: A) => A;
|
|
10
|
+
//# sourceMappingURL=reuse.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reuse.d.ts","sourceRoot":"","sources":["../../../src/internal/reuse.ts"],"names":[],"mappings":"AAgEA;;;;;;;GAOG;AACH,eAAO,MAAM,KAAK,GAAI,CAAC,EAAE,UAAU,CAAC,EAAE,MAAM,CAAC,KAAG,CAAsC,CAAA"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Context, Effect, Layer } from 'effect';
|
|
2
|
+
/**
|
|
3
|
+
* Coalesces store notifications into a single microtask flush so a batch of
|
|
4
|
+
* writes wakes each subscriber at most once (RESEARCH #3). React owns frame
|
|
5
|
+
* timing; we only collapse the notifications.
|
|
6
|
+
*
|
|
7
|
+
* One scheduler is shared by every store in a runtime, so writes across
|
|
8
|
+
* different stores in the same tick batch into one flush. The instance is
|
|
9
|
+
* resolved per store at creation: `Notifications` when a runtime provides it
|
|
10
|
+
* (per-runtime isolation — see `resolveScheduler`), else the process-wide
|
|
11
|
+
* `defaultScheduler`.
|
|
12
|
+
*/
|
|
13
|
+
export interface Scheduler {
|
|
14
|
+
readonly schedule: (listeners: Iterable<() => void>) => void;
|
|
15
|
+
}
|
|
16
|
+
export declare const makeScheduler: () => Scheduler;
|
|
17
|
+
/**
|
|
18
|
+
* The process-wide scheduler, used by any store created outside a runtime that
|
|
19
|
+
* provides its own `Notifications`. Fine for a single client app (microtask
|
|
20
|
+
* ordering is global anyway); a runtime that needs isolation — concurrent SSR,
|
|
21
|
+
* multiple mounted roots — provides `Notifications` upstream of its stores.
|
|
22
|
+
*/
|
|
23
|
+
export declare const defaultScheduler: Scheduler;
|
|
24
|
+
declare const Notifications_base: Context.TagClass<Notifications, "reform/Notifications", Scheduler>;
|
|
25
|
+
/**
|
|
26
|
+
* Optional per-runtime scheduler. When a runtime provides it upstream of its
|
|
27
|
+
* state/calc layers, those stores coalesce on it instead of the global default,
|
|
28
|
+
* isolating their notification timing from other runtimes in the same process.
|
|
29
|
+
*/
|
|
30
|
+
export declare class Notifications extends Notifications_base {
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* A fresh per-runtime scheduler. Merged into `Engine`, so a runtime that wires
|
|
34
|
+
* its state/calc layers *downstream* of `Engine` gets isolated notification
|
|
35
|
+
* timing; the common sibling wiring falls back to `defaultScheduler` (still
|
|
36
|
+
* correct, just process-shared).
|
|
37
|
+
*/
|
|
38
|
+
export declare const notificationsLayer: Layer.Layer<Notifications>;
|
|
39
|
+
/**
|
|
40
|
+
* Resolve the scheduler a store should use: the runtime's `Notifications` if one
|
|
41
|
+
* is in context, else the global default. Uses `serviceOption` so it imposes no
|
|
42
|
+
* hard requirement — a store layer wired as a sibling of the runtime (the common
|
|
43
|
+
* pattern) simply falls back to the default.
|
|
44
|
+
*/
|
|
45
|
+
export declare const resolveScheduler: Effect.Effect<Scheduler>;
|
|
46
|
+
export {};
|
|
47
|
+
//# sourceMappingURL=scheduler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scheduler.d.ts","sourceRoot":"","sources":["../../../src/internal/scheduler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAsB,MAAM,QAAQ,CAAA;AAEnE;;;;;;;;;;GAUG;AACH,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,QAAQ,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC,MAAM,IAAI,CAAC,KAAK,IAAI,CAAA;CAC7D;AAED,eAAO,MAAM,aAAa,QAAO,SAuChC,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,EAAE,SAA2B,CAAA;;AAE1D;;;;GAIG;AACH,qBAAa,aAAc,SAAQ,kBAA+D;CAAG;AAErG;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,KAAK,CAAC,aAAa,CAA4C,CAAA;AAEtG;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,MAAM,CAAC,SAAS,CAGrD,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { FiberRef } from 'effect';
|
|
2
|
+
/**
|
|
3
|
+
* The sanctioned tooling/test seam for seeding CLOSED scenes. A scene's layers
|
|
4
|
+
* are pre-composed (each state group seeds its own live store), so an outer
|
|
5
|
+
* layer cannot override an inner store — but a FiberRef set via
|
|
6
|
+
* `Layer.locally(ref, value)(layer)` IS visible inside the construction effects
|
|
7
|
+
* of nested layers. `State.live` consults this ref at store-construction time:
|
|
8
|
+
* if the state's member name is present, the (schema-validated) value replaces
|
|
9
|
+
* the authored seed; otherwise the authored seed wins.
|
|
10
|
+
*
|
|
11
|
+
* Empty by default — production wiring never touches it. The dev-tool inspector
|
|
12
|
+
* (`Scene.seedScene`) and proofs are the only intended writers. `globalValue`
|
|
13
|
+
* keeps a single ref instance even if the module is loaded twice (duplicated
|
|
14
|
+
* bundles, HMR), so the writer and the reader always agree.
|
|
15
|
+
*/
|
|
16
|
+
export declare const CurrentSeedOverrides: FiberRef.FiberRef<Readonly<Record<string, unknown>>>;
|
|
17
|
+
//# sourceMappingURL=seeds.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seeds.d.ts","sourceRoot":"","sources":["../../../src/internal/seeds.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAe,MAAM,QAAQ,CAAA;AAE9C;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAGnF,CAAA"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { type Context, Effect } from 'effect';
|
|
2
|
+
import { type AnySource, type SourceName, type SourceValue } from '../state/token.js';
|
|
3
|
+
/** The decoded inputs handed to a calc body, keyed by each source's name. */
|
|
4
|
+
export type InputsObject<Inputs extends ReadonlyArray<AnySource>> = {
|
|
5
|
+
readonly [S in Inputs[number] as SourceName<S>]: SourceValue<S>;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* The store services a list of store-carriers requires, as a *union of distinct*
|
|
9
|
+
* stores (each carrier has its own backing tag), not a single store of a union.
|
|
10
|
+
* Structural over the `store` tag, so it serves both calc inputs (`Source`s) and
|
|
11
|
+
* state-group members (`StateClass`es) — anything carrying a `store` tag.
|
|
12
|
+
*/
|
|
13
|
+
export type StoresOf<Items extends ReadonlyArray<unknown>> = {
|
|
14
|
+
[I in keyof Items]: Items[I] extends {
|
|
15
|
+
readonly store: Context.Tag<infer Svc, any>;
|
|
16
|
+
} ? Svc : never;
|
|
17
|
+
}[number];
|
|
18
|
+
/** The store requirement a calc's inputs impose. */
|
|
19
|
+
export type InputStores<Inputs extends ReadonlyArray<AnySource>> = StoresOf<Inputs>;
|
|
20
|
+
/** Project inputs into a comparable key; the calc reacts only when it moves. */
|
|
21
|
+
export type InvalidateBy<Inputs extends ReadonlyArray<AnySource>> = (inputs: InputsObject<Inputs>) => ReadonlyArray<unknown>;
|
|
22
|
+
/** Element-wise value equality of two invalidation keys. */
|
|
23
|
+
export declare const sameKey: (a: ReadonlyArray<unknown>, b: ReadonlyArray<unknown>) => boolean;
|
|
24
|
+
/** The sensing surface both `Calc.live` and `AsyncCalc.live` build on. */
|
|
25
|
+
export interface WiredSources<Inputs extends ReadonlyArray<AnySource>> {
|
|
26
|
+
/** Snapshot every input by name — the decoded inputs object a calc body sees. */
|
|
27
|
+
readonly snapshot: () => InputsObject<Inputs>;
|
|
28
|
+
/** The invalidation key for an inputs object: the projection, or all input values. */
|
|
29
|
+
readonly keyOf: (inputs: InputsObject<Inputs>) => ReadonlyArray<unknown>;
|
|
30
|
+
/** Subscribe to every source at once; the returned thunk unsubscribes from all. */
|
|
31
|
+
readonly subscribe: (listener: () => void) => () => void;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Read each input's backing store and return the shared sensing surface. The
|
|
35
|
+
* caller owns lifecycle: register the `subscribe` result's unsubscribe as a
|
|
36
|
+
* scope finalizer (both live bodies run under `Layer.scoped`).
|
|
37
|
+
*/
|
|
38
|
+
export declare const wireSources: <Inputs extends ReadonlyArray<AnySource>>(inputs: Inputs, invalidateBy?: InvalidateBy<Inputs>) => Effect.Effect<WiredSources<Inputs>, never, InputStores<Inputs>>;
|
|
39
|
+
//# sourceMappingURL=sources.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sources.d.ts","sourceRoot":"","sources":["../../../src/internal/sources.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,EAAoB,MAAM,QAAQ,CAAA;AAC/D,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,UAAU,EAAE,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAQlF,6EAA6E;AAC7E,MAAM,MAAM,YAAY,CAAC,MAAM,SAAS,aAAa,CAAC,SAAS,CAAC,IAAI;IAClE,QAAQ,EAAE,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC;CAChE,CAAA;AAED;;;;;GAKG;AACH,MAAM,MAAM,QAAQ,CAAC,KAAK,SAAS,aAAa,CAAC,OAAO,CAAC,IAAI;KAC1D,CAAC,IAAI,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,SAAS;QAAE,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC,MAAM,GAAG,EAAE,GAAG,CAAC,CAAA;KAAE,GAAG,GAAG,GAAG,KAAK;CACnG,CAAC,MAAM,CAAC,CAAA;AAET,oDAAoD;AACpD,MAAM,MAAM,WAAW,CAAC,MAAM,SAAS,aAAa,CAAC,SAAS,CAAC,IAAI,QAAQ,CAAC,MAAM,CAAC,CAAA;AAEnF,gFAAgF;AAChF,MAAM,MAAM,YAAY,CAAC,MAAM,SAAS,aAAa,CAAC,SAAS,CAAC,IAAI,CAClE,MAAM,EAAE,YAAY,CAAC,MAAM,CAAC,KACzB,aAAa,CAAC,OAAO,CAAC,CAAA;AAuB3B,4DAA4D;AAC5D,eAAO,MAAM,OAAO,GAAI,GAAG,aAAa,CAAC,OAAO,CAAC,EAAE,GAAG,aAAa,CAAC,OAAO,CAAC,KAAG,OACJ,CAAA;AAE3E,0EAA0E;AAC1E,MAAM,WAAW,YAAY,CAAC,MAAM,SAAS,aAAa,CAAC,SAAS,CAAC;IACnE,iFAAiF;IACjF,QAAQ,CAAC,QAAQ,EAAE,MAAM,YAAY,CAAC,MAAM,CAAC,CAAA;IAC7C,sFAAsF;IACtF,QAAQ,CAAC,KAAK,EAAE,CAAC,MAAM,EAAE,YAAY,CAAC,MAAM,CAAC,KAAK,aAAa,CAAC,OAAO,CAAC,CAAA;IACxE,mFAAmF;IACnF,QAAQ,CAAC,SAAS,EAAE,CAAC,QAAQ,EAAE,MAAM,IAAI,KAAK,MAAM,IAAI,CAAA;CACzD;AAED;;;;GAIG;AACH,eAAO,MAAM,WAAW,GAAI,MAAM,SAAS,aAAa,CAAC,SAAS,CAAC,EACjE,QAAQ,MAAM,EACd,eAAe,YAAY,CAAC,MAAM,CAAC,KAClC,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,CA4BM,CAAA"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { type Inspectable } from './inspect.js';
|
|
2
|
+
import { type Scheduler } from './scheduler.js';
|
|
3
|
+
/**
|
|
4
|
+
* A reactive cell living outside Effect. The single source of truth for one
|
|
5
|
+
* slice of state. `set` is internal: only the reduce loop ever holds a Store
|
|
6
|
+
* (reducers return values, the loop writes them), which is how "state changes
|
|
7
|
+
* only in the reduce loop" is enforced structurally — there is no public writer.
|
|
8
|
+
*
|
|
9
|
+
* This is the synchronous, React-facing analog of Effect's `SubscriptionRef`
|
|
10
|
+
* (a `Ref` + `PubSub` + a `changes` `Stream`). We don't use `SubscriptionRef`
|
|
11
|
+
* directly because `useSyncExternalStore` requires a *synchronous* `getSnapshot`
|
|
12
|
+
* and a *synchronous* `subscribe` returning an unsubscribe thunk, whereas
|
|
13
|
+
* `SubscriptionRef.get` is an `Effect` and its `changes` is a `Stream` (a fiber
|
|
14
|
+
* per subscription). Mutable state is held in a `MutableRef` (Effect's mutable
|
|
15
|
+
* cell), so there is no reassigned binding.
|
|
16
|
+
*
|
|
17
|
+
* `getSnapshot` + `subscribe` are the stable pair the React bridge binds to;
|
|
18
|
+
* `getSnapshot` returns the same reference until the value actually changes.
|
|
19
|
+
* `getVersion` returns a monotonic counter bumped on every real change — the
|
|
20
|
+
* host sums it across a render's tracked stores for a `useSyncExternalStore`
|
|
21
|
+
* snapshot, which closes the tear/dropped-update window a value snapshot can't.
|
|
22
|
+
*/
|
|
23
|
+
export interface Store<in out A> extends Inspectable {
|
|
24
|
+
get(): A;
|
|
25
|
+
set(value: A): void;
|
|
26
|
+
getSnapshot(): A;
|
|
27
|
+
getVersion(): number;
|
|
28
|
+
subscribe(listener: () => void): () => void;
|
|
29
|
+
}
|
|
30
|
+
export declare const makeStore: <A>(initial: A, scheduler?: Scheduler) => Store<A>;
|
|
31
|
+
/**
|
|
32
|
+
* A read-only `Store` whose value is computed from upstream sources.
|
|
33
|
+
*
|
|
34
|
+
* Reads are pull-fresh: `get`/`getSnapshot` call `compute` directly, so a
|
|
35
|
+
* headless snapshot always reflects the current source state without waiting for
|
|
36
|
+
* a notification (`compute` must memoize so an unchanged read returns a stable
|
|
37
|
+
* reference — `useSyncExternalStore` requires it). *Notifications*, by contrast,
|
|
38
|
+
* run through the same coalescing scheduler as `makeStore`: an upstream change
|
|
39
|
+
* recomputes once and wakes subscribers only when the output actually moves (by
|
|
40
|
+
* `Equal.equals`), so every store kind shares one notification timing. `set` is
|
|
41
|
+
* a no-op — the only writer is the upstream subscription.
|
|
42
|
+
*/
|
|
43
|
+
export declare const makeDerivedStore: <A>(compute: () => A, subscribeUpstream: (onChange: () => void) => () => void, scheduler?: Scheduler) => {
|
|
44
|
+
readonly store: Store<A>;
|
|
45
|
+
readonly unsubscribe: () => void;
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../src/internal/store.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,WAAW,EAAe,MAAM,WAAW,CAAA;AACzD,OAAO,EAAoB,KAAK,SAAS,EAAE,MAAM,aAAa,CAAA;AAE9D;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,WAAW,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAE,SAAQ,WAAW;IAClD,GAAG,IAAI,CAAC,CAAA;IACR,GAAG,CAAC,KAAK,EAAE,CAAC,GAAG,IAAI,CAAA;IACnB,WAAW,IAAI,CAAC,CAAA;IAChB,UAAU,IAAI,MAAM,CAAA;IACpB,SAAS,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAAA;CAC5C;AAED,eAAO,MAAM,SAAS,GAAI,CAAC,EAAE,SAAS,CAAC,EAAE,YAAW,SAA4B,KAAG,KAAK,CAAC,CAAC,CAwBzF,CAAA;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,gBAAgB,GAAI,CAAC,EAChC,SAAS,MAAM,CAAC,EAChB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,IAAI,KAAK,MAAM,IAAI,EACvD,YAAW,SAA4B,KACtC;IAAE,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;IAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,IAAI,CAAA;CA8B9D,CAAA"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Context, Effect } from 'effect';
|
|
2
|
+
import type { Store } from './store.js';
|
|
3
|
+
/**
|
|
4
|
+
* Anything a render can depend on: a source it can subscribe to for changes and
|
|
5
|
+
* snapshot a monotonic version from. `Store` (and the calc/family stores)
|
|
6
|
+
* structurally satisfy this. The host sums `getVersion()` across a render's
|
|
7
|
+
* tracked sources for its `useSyncExternalStore` snapshot — a value that moves
|
|
8
|
+
* whenever any dependency changes, which is what closes the tear/dropped-update
|
|
9
|
+
* window a per-store value snapshot cannot.
|
|
10
|
+
*/
|
|
11
|
+
export interface Subscribable {
|
|
12
|
+
subscribe(listener: () => void): () => void;
|
|
13
|
+
getVersion(): number;
|
|
14
|
+
}
|
|
15
|
+
/** A per-render dependency sink. The renderer provides one; reads record into it. */
|
|
16
|
+
export interface Tracker {
|
|
17
|
+
add(source: Subscribable): void;
|
|
18
|
+
}
|
|
19
|
+
declare const CurrentTracker_base: Context.TagClass<CurrentTracker, "reform/Tracker", Tracker>;
|
|
20
|
+
/**
|
|
21
|
+
* The active render's dependency tracker (D5). Present only while a composition
|
|
22
|
+
* is rendering under `@reform/react`; absent in procedures and headless reads.
|
|
23
|
+
*/
|
|
24
|
+
export declare class CurrentTracker extends CurrentTracker_base {
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Read a store's current snapshot and, if a tracker is active, record the store
|
|
28
|
+
* as a dependency of the current render. One read API, two behaviors by context
|
|
29
|
+
* (D5): inside a render it subscribes the slice; elsewhere it just snapshots.
|
|
30
|
+
*/
|
|
31
|
+
export declare const readTracked: <A>(store: Store<A>) => Effect.Effect<A>;
|
|
32
|
+
export {};
|
|
33
|
+
//# sourceMappingURL=track.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"track.d.ts","sourceRoot":"","sources":["../../../src/internal/track.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAU,MAAM,QAAQ,CAAA;AAChD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAEpC;;;;;;;GAOG;AACH,MAAM,WAAW,YAAY;IAC3B,SAAS,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAAA;IAC3C,UAAU,IAAI,MAAM,CAAA;CACrB;AAED,qFAAqF;AACrF,MAAM,WAAW,OAAO;IACtB,GAAG,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAAA;CAChC;;AAED;;;GAGG;AACH,qBAAa,cAAe,SAAQ,mBAAwD;CAAG;AAE/F;;;;GAIG;AACH,eAAO,MAAM,WAAW,GAAI,CAAC,EAAE,OAAO,KAAK,CAAC,CAAC,CAAC,KAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAI5D,CAAA"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Effect, Layer } from 'effect';
|
|
2
|
+
import type { YieldWrap } from 'effect/Utils';
|
|
3
|
+
import { type ChannelClass, Procedures } from '../channel/channel.js';
|
|
4
|
+
import { type Manifest } from '../definition/definition.js';
|
|
5
|
+
import { type AnyEvent, type EventType } from '../event/event.js';
|
|
6
|
+
import { type Ctx } from '../internal/ctx.js';
|
|
7
|
+
import { Bus } from '../runtime/bus.js';
|
|
8
|
+
/** The reflectable descriptor a procedure carries. */
|
|
9
|
+
export interface ProcedureManifest extends Manifest {
|
|
10
|
+
readonly kind: 'Procedure';
|
|
11
|
+
}
|
|
12
|
+
export interface ProcedureClass<Events extends ReadonlyArray<AnyEvent>> {
|
|
13
|
+
new (): {};
|
|
14
|
+
readonly manifest: ProcedureManifest;
|
|
15
|
+
/** The trigger events (marker data; read by `Procedure.live`). */
|
|
16
|
+
readonly events: Events;
|
|
17
|
+
/** The channel this procedure's runs are scheduled on (marker data). */
|
|
18
|
+
readonly channel: ChannelClass;
|
|
19
|
+
}
|
|
20
|
+
export interface ProcedureConfig<Events extends ReadonlyArray<AnyEvent>> {
|
|
21
|
+
readonly events: Events;
|
|
22
|
+
/** The scheduling lane. Replaces the old `concurrency` option. */
|
|
23
|
+
readonly channel: ChannelClass;
|
|
24
|
+
}
|
|
25
|
+
export type AnyProcedure = ProcedureClass<ReadonlyArray<AnyEvent>>;
|
|
26
|
+
/**
|
|
27
|
+
* A cross-event-loop flow. The *definition* declares its trigger events and the
|
|
28
|
+
* channel it runs on; the *implementation* is the effectful body. Procedures no
|
|
29
|
+
* longer subscribe to the bus themselves — the single drain loop routes events
|
|
30
|
+
* to the channel, which runs the registered bodies under its policy.
|
|
31
|
+
*/
|
|
32
|
+
export declare const make: <const Events extends ReadonlyArray<AnyEvent>>(name: string, config: ProcedureConfig<Events>) => ProcedureClass<Events>;
|
|
33
|
+
/**
|
|
34
|
+
* Register the flow body into its channel. The body may read state and dispatch
|
|
35
|
+
* events, but never writes state (the core invariant); its context requirements
|
|
36
|
+
* (RPC clients, etc.) are captured here so the channel fiber can run it with no
|
|
37
|
+
* outstanding R.
|
|
38
|
+
*/
|
|
39
|
+
export declare const live: <Events extends ReadonlyArray<AnyEvent>, Eff extends YieldWrap<Effect.Effect<any, any, any>>, Done>(procedure: ProcedureClass<Events>, body: (event: EventType<Events[number]>) => Generator<Eff, Done, never>) => Layer.Layer<never, never, Procedures | Bus | Ctx<Eff>>;
|
|
40
|
+
//# sourceMappingURL=procedure.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"procedure.d.ts","sourceRoot":"","sources":["../../../src/procedure/procedure.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAA;AACtC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAC7C,OAAO,EAAE,KAAK,YAAY,EAAuB,UAAU,EAAE,MAAM,oBAAoB,CAAA;AACvF,OAAO,EAAE,KAAK,QAAQ,EAAmB,MAAM,0BAA0B,CAAA;AACzE,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC9D,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,iBAAiB,C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K,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,EAAE,UAAU,GAAG,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,CA6BvD,CAAA"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Layer } from 'effect';
|
|
2
|
+
import { type Manifest } from '../definition/definition.js';
|
|
3
|
+
import { type AnyEvent, type EventType } from '../event/event.js';
|
|
4
|
+
import type { Store } from '../internal/store.js';
|
|
5
|
+
import { type AnyState, type StateValue } from '../state/state.js';
|
|
6
|
+
import { type AnyFamily, type FamilyKey, type FamilyStore, type FamilyValue, Tombstone } from '../state/stateFamily.js';
|
|
7
|
+
import { Reducers } from '../runtime/loop.js';
|
|
8
|
+
/** The reflectable descriptor a reducer carries, like every other primitive's `*Manifest`. */
|
|
9
|
+
export interface ReducerManifest extends Manifest {
|
|
10
|
+
readonly kind: 'Reducer';
|
|
11
|
+
}
|
|
12
|
+
export interface StateReducerConfig<S extends AnyState, Events extends ReadonlyArray<AnyEvent>> {
|
|
13
|
+
readonly states: readonly [S];
|
|
14
|
+
readonly events: Events;
|
|
15
|
+
}
|
|
16
|
+
export interface FamilyReducerConfig<F extends AnyFamily, Events extends ReadonlyArray<AnyEvent>> {
|
|
17
|
+
readonly family: F;
|
|
18
|
+
readonly keyOf: (event: EventType<Events[number]>) => FamilyKey<F>;
|
|
19
|
+
readonly events: Events;
|
|
20
|
+
}
|
|
21
|
+
export interface StateReducerClass<S extends AnyState, Events extends ReadonlyArray<AnyEvent>> {
|
|
22
|
+
new (): {};
|
|
23
|
+
readonly manifest: ReducerManifest;
|
|
24
|
+
/** Marker data read by `Reducer.live`. */
|
|
25
|
+
readonly config: StateReducerConfig<S, Events>;
|
|
26
|
+
readonly handles: ReadonlySet<string>;
|
|
27
|
+
}
|
|
28
|
+
export interface FamilyReducerClass<F extends AnyFamily, Events extends ReadonlyArray<AnyEvent>> {
|
|
29
|
+
new (): {};
|
|
30
|
+
readonly manifest: ReducerManifest;
|
|
31
|
+
readonly config: FamilyReducerConfig<F, Events>;
|
|
32
|
+
readonly handles: ReadonlySet<string>;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Reducers are the only writers of state. The *definition* (`Reducer.make`)
|
|
36
|
+
* declares which state and events it touches; the *implementation*
|
|
37
|
+
* (`Reducer.live`) is the pure fold. An unhandled event is a no-op because
|
|
38
|
+
* it is never in `handles`.
|
|
39
|
+
*/
|
|
40
|
+
export declare function make<S extends AnyState, const Events extends ReadonlyArray<AnyEvent>>(name: string, config: StateReducerConfig<S, Events>): StateReducerClass<S, Events>;
|
|
41
|
+
export declare function make<F extends AnyFamily, const Events extends ReadonlyArray<AnyEvent>>(name: string, config: FamilyReducerConfig<F, Events>): FamilyReducerClass<F, Events>;
|
|
42
|
+
export declare function live<S extends AnyState, Events extends ReadonlyArray<AnyEvent>>(reducer: StateReducerClass<S, Events>, fold: (value: StateValue<S>, event: EventType<Events[number]>) => StateValue<S>): Layer.Layer<never, never, Reducers | Store<StateValue<S>>>;
|
|
43
|
+
export declare function live<F extends AnyFamily, Events extends ReadonlyArray<AnyEvent>>(reducer: FamilyReducerClass<F, Events>, fold: (entry: FamilyValue<F>, event: EventType<Events[number]>) => FamilyValue<F> | Tombstone): Layer.Layer<never, never, Reducers | FamilyStore<FamilyKey<F>, FamilyValue<F>>>;
|
|
44
|
+
//# sourceMappingURL=reducer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reducer.d.ts","sourceRoot":"","sources":["../../../src/reducer/reducer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,KAAK,EAAE,MAAM,QAAQ,CAAA;AACtC,OAAO,EAAE,KAAK,QAAQ,EAAmB,MAAM,0BAA0B,CAAA;AAEzE,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC9D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAC9C,OAAO,EAAE,KA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