/** * @module build-classify * @category Internal * * Build-time classification of the registry + state map. The Act constructor * needs four pre-computed inputs to wire its runtime subsystems: * * - `static_targets` — known-up-front reaction targets, subscribed once * at init (correlate marks them from then on) * - `reactive_events` — event names with at least one reaction (drives * the drain skip-flag in `do()` and `reset()`) * - `event_to_state` — event-name → owning state, for `close({restart})` * seed loading in multi-state apps * * Pure function — single pass over events + states, fully testable without * instantiating Act. * * @internal */ import type { StaticTarget } from "../internal/index.js"; import type { Registry, Schema, SchemaRegister, Schemas, State } from "../types/index.js"; /** * Classification result. Returned by {@link classify_registry}; consumed * piecewise by Act's constructor. * * @internal */ /** * Sentinel for "any reaction on this event has a dynamic resolver, so * the lane is opaque until correlate runs the function — arm every * controller." A Symbol rather than a string literal so it can't * collide with a user-declared lane named `"all"`. * * @internal */ export declare const ALL_LANES: unique symbol; /** * Per-event lane fan-in (ACT-1103). For events whose every reaction * has a static resolver, the value is the union of those reactions' * declared lanes — `do()` arms only those controllers on commit. For * events with at least one dynamic resolver, the value is * {@link ALL_LANES}; `do()` falls back to arming every controller. * * @internal */ export type EventLaneSet = ReadonlySet | typeof ALL_LANES; export type Classification = { readonly static_targets: StaticTarget[]; readonly reactive_events: ReadonlySet; readonly event_to_state: ReadonlyMap>; readonly event_to_lanes: ReadonlyMap; }; /** * Walk the registry once to collect static reaction targets, the set of * reactive event names, the per-event lane fan-in, and the event-to-state * map. Static targets are deduplicated by (target, source) — two reactions * routing to the same projection produce one subscription. * * @internal */ export declare function classify_registry, TEvents extends Schemas, TActions extends Schemas>(registry: Registry, states: ReadonlyMap>): Classification; //# sourceMappingURL=build-classify.d.ts.map