@rotorsoft/act 0.14.0 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -14,27 +14,27 @@ import type { Committed, EventRegister, ReactionResolver, Schema, Schemas } from
14
14
  * A self-contained projection grouping read-model update handlers.
15
15
  * Projections are composed into an Act orchestrator via `act().withProjection(projection)`.
16
16
  *
17
- * @template E - Event schemas handled by this projection
17
+ * @template TEvents - Event schemas handled by this projection
18
18
  */
19
- export type Projection<E extends Schemas> = {
19
+ export type Projection<TEvents extends Schemas> = {
20
20
  readonly _tag: "Projection";
21
- readonly events: EventRegister<E>;
21
+ readonly events: EventRegister<TEvents>;
22
22
  };
23
23
  /** Helper: a single-key record mapping an event name to its Zod schema. */
24
- type EventEntry<K extends string = string, D extends Schema = Schema> = {
25
- [P in K]: ZodType<D>;
24
+ type EventEntry<TKey extends string = string, TData extends Schema = Schema> = {
25
+ [P in TKey]: ZodType<TData>;
26
26
  };
27
27
  /** Infer the handler-result type after registering one event. */
28
- type DoResult<E extends Schemas, K extends string, D extends Schema> = ProjectionBuilder<E & {
29
- [P in K]: D;
28
+ type DoResult<TEvents extends Schemas, TKey extends string, TData extends Schema> = ProjectionBuilder<TEvents & {
29
+ [P in TKey]: TData;
30
30
  }> & {
31
- to: (resolver: ReactionResolver<E & {
32
- [P in K]: D;
33
- }, K> | string) => ProjectionBuilder<E & {
34
- [P in K]: D;
31
+ to: (resolver: ReactionResolver<TEvents & {
32
+ [P in TKey]: TData;
33
+ }, TKey> | string) => ProjectionBuilder<TEvents & {
34
+ [P in TKey]: TData;
35
35
  }>;
36
- void: () => ProjectionBuilder<E & {
37
- [P in K]: D;
36
+ void: () => ProjectionBuilder<TEvents & {
37
+ [P in TKey]: TData;
38
38
  }>;
39
39
  };
40
40
  /**
@@ -48,9 +48,9 @@ type DoResult<E extends Schemas, K extends string, D extends Schema> = Projectio
48
48
  * handlers inherit that resolver. Per-handler `.to()` or `.void()` can
49
49
  * still override it.
50
50
  *
51
- * @template E - Event schemas
51
+ * @template TEvents - Event schemas
52
52
  */
53
- export type ProjectionBuilder<E extends Schemas> = {
53
+ export type ProjectionBuilder<TEvents extends Schemas> = {
54
54
  /**
55
55
  * Begins defining a projection handler for a specific event.
56
56
  *
@@ -58,19 +58,19 @@ export type ProjectionBuilder<E extends Schemas> = {
58
58
  * when the variable name matches the event name. The key becomes the
59
59
  * event name, the value the Zod schema.
60
60
  */
61
- on: <K extends string, D extends Schema>(entry: EventEntry<K, D>) => {
62
- do: (handler: (event: Committed<E & {
63
- [P in K]: D;
64
- }, K>, stream: string) => Promise<void>) => DoResult<E, K, D>;
61
+ on: <TKey extends string, TData extends Schema>(entry: EventEntry<TKey, TData>) => {
62
+ do: (handler: (event: Committed<TEvents & {
63
+ [P in TKey]: TData;
64
+ }, TKey>, stream: string) => Promise<void>) => DoResult<TEvents, TKey, TData>;
65
65
  };
66
66
  /**
67
67
  * Builds and returns the Projection data structure.
68
68
  */
69
- build: () => Projection<E>;
69
+ build: () => Projection<TEvents>;
70
70
  /**
71
71
  * The registered event schemas and their reaction maps.
72
72
  */
73
- readonly events: EventRegister<E>;
73
+ readonly events: EventRegister<TEvents>;
74
74
  };
75
75
  /**
76
76
  * Creates a new projection builder for composing read-model update handlers.
@@ -114,6 +114,6 @@ export type ProjectionBuilder<E extends Schemas> = {
114
114
  * @see {@link ProjectionBuilder} for builder methods
115
115
  * @see {@link Projection} for the output type
116
116
  */
117
- export declare function projection<E extends Schemas = {}>(target?: string, events?: EventRegister<E>): ProjectionBuilder<E>;
117
+ export declare function projection<TEvents extends Schemas = {}>(target?: string, events?: EventRegister<TEvents>): ProjectionBuilder<TEvents>;
118
118
  export {};
119
119
  //# sourceMappingURL=projection-builder.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"projection-builder.d.ts","sourceRoot":"","sources":["../../src/projection-builder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,O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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,wBAAgB,UAAU,CAAC,OAAO,SAAS,OAAO,GAAG,EAAE,EACrD,MAAM,CAAC,EAAE,MAAM,EACf,MAAM,GAAE,aAAa,CAAC,OAAO,CAAgC,GAC5D,iBAAiB,CAAC,OAAO,CAAC,CAkF5B"}
@@ -1,24 +1,27 @@
1
1
  import type { Projection } from "./projection-builder.js";
2
- import type { Committed, Dispatcher, EventRegister, ReactionOptions, ReactionResolver, Schema, SchemaRegister, Schemas, Snapshot, State } from "./types/index.js";
2
+ import type { Actor, Committed, Dispatcher, EventRegister, ReactionOptions, ReactionResolver, Schema, SchemaRegister, Schemas, Snapshot, State } from "./types/index.js";
3
3
  /**
4
4
  * A self-contained functional slice grouping partial states with their
5
5
  * scoped reactions. Slices are composed into an Act orchestrator via
6
6
  * `act().withSlice(slice)`.
7
7
  *
8
- * @template S - Schema register for states
9
- * @template E - Event schemas from this slice's states
10
- * @template A - Action schemas from this slice's states
11
- * @template M - Map of state names to state schemas
8
+ * @template TSchemaReg - Schema register for states
9
+ * @template TEvents - Event schemas from this slice's states
10
+ * @template TActions - Action schemas from this slice's states
11
+ * @template TStateMap - Map of state names to state schemas
12
+ * @template TActor - Actor type extending base Actor
12
13
  */
13
- export type Slice<S extends SchemaRegister<A>, E extends Schemas, A extends Schemas, M extends Record<string, Schema> = {}> = {
14
+ export type Slice<TSchemaReg extends SchemaRegister<TActions>, TEvents extends Schemas, TActions extends Schemas, TStateMap extends Record<string, Schema> = {}, TActor extends Actor = Actor> = {
14
15
  readonly _tag: "Slice";
15
16
  readonly states: Map<string, State<any, any, any>>;
16
- readonly events: EventRegister<E>;
17
+ readonly events: EventRegister<TEvents>;
17
18
  readonly projections: ReadonlyArray<Projection<any>>;
18
19
  /** @internal phantom field for type-level state schema tracking */
19
- readonly _S?: S;
20
+ readonly _S?: TSchemaReg;
20
21
  /** @internal phantom field for type-level state name tracking */
21
- readonly _M?: M;
22
+ readonly _M?: TStateMap;
23
+ /** @internal phantom field for type-level actor tracking */
24
+ readonly _TActor?: TActor;
22
25
  };
23
26
  /**
24
27
  * Fluent builder interface for composing functional slices.
@@ -26,12 +29,13 @@ export type Slice<S extends SchemaRegister<A>, E extends Schemas, A extends Sche
26
29
  * Provides a chainable API for registering states and projections,
27
30
  * and defining reactions scoped to the slice's own events.
28
31
  *
29
- * @template S - Schema register for states
30
- * @template E - Event schemas
31
- * @template A - Action schemas
32
- * @template M - Map of state names to state schemas
32
+ * @template TSchemaReg - Schema register for states
33
+ * @template TEvents - Event schemas
34
+ * @template TActions - Action schemas
35
+ * @template TStateMap - Map of state names to state schemas
36
+ * @template TActor - Actor type extending base Actor
33
37
  */
34
- export type SliceBuilder<S extends SchemaRegister<A>, E extends Schemas, A extends Schemas, M extends Record<string, Schema> = {}> = {
38
+ export type SliceBuilder<TSchemaReg extends SchemaRegister<TActions>, TEvents extends Schemas, TActions extends Schemas, TStateMap extends Record<string, Schema> = {}, TActor extends Actor = Actor> = {
35
39
  /**
36
40
  * Registers a state definition with the slice.
37
41
  *
@@ -39,35 +43,35 @@ export type SliceBuilder<S extends SchemaRegister<A>, E extends Schemas, A exten
39
43
  * dispatch. Duplicate registrations (same state in multiple slices)
40
44
  * are handled automatically at composition time.
41
45
  */
42
- withState: <SX extends Schema, EX extends Schemas, AX extends Schemas, NX extends string = string>(state: State<SX, EX, AX, NX>) => SliceBuilder<S & {
43
- [K in keyof AX]: SX;
44
- }, E & EX, A & AX, M & {
45
- [K in NX]: SX;
46
- }>;
46
+ withState: <TNewState extends Schema, TNewEvents extends Schemas, TNewActions extends Schemas, TNewName extends string = string>(state: State<TNewState, TNewEvents, TNewActions, TNewName>) => SliceBuilder<TSchemaReg & {
47
+ [K in keyof TNewActions]: TNewState;
48
+ }, TEvents & TNewEvents, TActions & TNewActions, TStateMap & {
49
+ [K in TNewName]: TNewState;
50
+ }, TActor>;
47
51
  /**
48
52
  * Embeds a built Projection within this slice. The projection's events
49
53
  * must be a subset of events from states already registered via
50
54
  * `.withState()`. Projection handlers preserve their `(event, stream)`
51
55
  * signature and do not receive a Dispatcher.
52
56
  */
53
- withProjection: <EP extends Schemas>(projection: [Exclude<keyof EP, keyof E>] extends [never] ? Projection<EP> : never) => SliceBuilder<S, E, A, M>;
57
+ withProjection: <TNewEvents extends Schemas>(projection: [Exclude<keyof TNewEvents, keyof TEvents>] extends [never] ? Projection<TNewEvents> : never) => SliceBuilder<TSchemaReg, TEvents, TActions, TStateMap, TActor>;
54
58
  /**
55
59
  * Begins defining a reaction scoped to this slice's events.
56
60
  */
57
- on: <K extends keyof E>(event: K) => {
58
- do: (handler: (event: Committed<E, K>, stream: string, app: Dispatcher<A>) => Promise<Snapshot<Schema, E> | void>, options?: Partial<ReactionOptions>) => SliceBuilder<S, E, A, M> & {
59
- to: (resolver: ReactionResolver<E, K> | string) => SliceBuilder<S, E, A, M>;
60
- void: () => SliceBuilder<S, E, A, M>;
61
+ on: <TKey extends keyof TEvents>(event: TKey) => {
62
+ do: (handler: (event: Committed<TEvents, TKey>, stream: string, app: Dispatcher<TActions, TActor>) => Promise<Snapshot<Schema, TEvents> | void>, options?: Partial<ReactionOptions>) => SliceBuilder<TSchemaReg, TEvents, TActions, TStateMap, TActor> & {
63
+ to: (resolver: ReactionResolver<TEvents, TKey> | string) => SliceBuilder<TSchemaReg, TEvents, TActions, TStateMap, TActor>;
64
+ void: () => SliceBuilder<TSchemaReg, TEvents, TActions, TStateMap, TActor>;
61
65
  };
62
66
  };
63
67
  /**
64
68
  * Builds and returns the Slice data structure.
65
69
  */
66
- build: () => Slice<S, E, A, M>;
70
+ build: () => Slice<TSchemaReg, TEvents, TActions, TStateMap, TActor>;
67
71
  /**
68
72
  * The registered event schemas and their reaction maps.
69
73
  */
70
- readonly events: EventRegister<E>;
74
+ readonly events: EventRegister<TEvents>;
71
75
  };
72
76
  /**
73
77
  * Creates a new slice builder for composing partial states with scoped reactions.
@@ -102,5 +106,5 @@ export type SliceBuilder<S extends SchemaRegister<A>, E extends Schemas, A exten
102
106
  * @see {@link SliceBuilder} for builder methods
103
107
  * @see {@link Slice} for the output type
104
108
  */
105
- export declare function slice<S extends SchemaRegister<A> = {}, E extends Schemas = {}, A extends Schemas = {}, M extends Record<string, Schema> = {}>(states?: Map<string, State<any, any, any>>, actions?: Record<string, any>, events?: EventRegister<E>, projections?: Projection<any>[]): SliceBuilder<S, E, A, M>;
109
+ export declare function slice<TSchemaReg extends SchemaRegister<TActions> = {}, TEvents extends Schemas = {}, TActions extends Schemas = {}, TStateMap extends Record<string, Schema> = {}, TActor extends Actor = Actor>(states?: Map<string, State<any, any, any>>, actions?: Record<string, any>, events?: EventRegister<TEvents>, projections?: Projection<any>[]): SliceBuilder<TSchemaReg, TEvents, TActions, TStateMap, TActor>;
106
110
  //# sourceMappingURL=slice-builder.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"slice-builder.d.ts","sourceRoot":"","sources":["../../src/slice-builder.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,KAAK,EACV,SAAS,EACT,UAAU,EACV,aAAa,EAGb,eAAe,EACf,gBAAgB,EAChB,MAAM,EACN,cAAc,EACd,OAAO,EACP,QAAQ,EACR,KAAK,EACN,MAAM,kBAAkB,CAAC;AAE1B;;;;;;;;;GASG;AACH,MAAM,MAAM,KAAK,CACf,CAAC,SAAS,cAAc,CAAC,CAAC,CAAC,EAC3B,CAAC,SAAS,OAAO,EACjB,CAAC,SAAS,OAAO,EAEjB,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,EAAE,IACnC;IACF,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;IACnD,QAAQ,CAAC,MAAM,EAAE,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AAO,GAClC,YAAY,CAAC,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,CAAC,CA0FhE"}
@@ -12,12 +12,13 @@ import { ActionHandler, Invariant, PatchHandlers, Schema, Schemas, Snapshot, Sta
12
12
  * Provides a fluent API to configure the initial state, event types,
13
13
  * and event handlers (reducers) before moving to action configuration.
14
14
  *
15
- * @template S - State schema type
15
+ * @template TState - State schema type
16
+ * @template TName - State name literal type
16
17
  *
17
18
  * @see {@link state} for usage examples
18
19
  * @see {@link ActionBuilder} for action configuration
19
20
  */
20
- export type StateBuilder<S extends Schema, N extends string = string> = {
21
+ export type StateBuilder<TState extends Schema, TName extends string = string> = {
21
22
  /**
22
23
  * Defines the initial state for new state instances.
23
24
  *
@@ -37,14 +38,14 @@ export type StateBuilder<S extends Schema, N extends string = string> = {
37
38
  * .init((data) => ({ ...data, createdAt: new Date() }))
38
39
  * ```
39
40
  */
40
- init: (init: () => Readonly<S>) => {
41
+ init: (init: () => Readonly<TState>) => {
41
42
  /**
42
43
  * Declares the event types that this state can emit.
43
44
  *
44
45
  * Events represent facts that have happened - they should be named in past tense.
45
46
  * Each event is defined with a Zod schema for type safety and runtime validation.
46
47
  *
47
- * @template E - Event schemas type
48
+ * @template TEvents - Event schemas type
48
49
  * @param events - Object mapping event names to Zod schemas
49
50
  * @returns An ActionBuilder (with optional `.patch()` to override specific reducers)
50
51
  *
@@ -57,7 +58,7 @@ export type StateBuilder<S extends Schema, N extends string = string> = {
57
58
  * })
58
59
  * ```
59
60
  */
60
- emits: <E extends Schemas>(events: ZodTypes<E>) => ActionBuilder<S, E, {}, N> & {
61
+ emits: <TEvents extends Schemas>(events: ZodTypes<TEvents>) => ActionBuilder<TState, TEvents, {}, TName> & {
61
62
  /**
62
63
  * Overrides specific event reducers. Events without a custom patch
63
64
  * default to passthrough: `({ data }) => data` (event data merges
@@ -78,17 +79,17 @@ export type StateBuilder<S extends Schema, N extends string = string> = {
78
79
  * // TicketClosed and TicketResolved use passthrough
79
80
  * ```
80
81
  */
81
- patch: (patch: Partial<PatchHandlers<S, E>>) => ActionBuilder<S, E, {}, N>;
82
+ patch: (patch: Partial<PatchHandlers<TState, TEvents>>) => ActionBuilder<TState, TEvents, {}, TName>;
82
83
  };
83
84
  };
84
85
  };
85
86
  /** Helper: a single-key record mapping a state name to its Zod schema. */
86
- type StateEntry<K extends string = string, S extends Schema = Schema> = {
87
- [P in K]: ZodType<S>;
87
+ type StateEntry<TKey extends string = string, TState extends Schema = Schema> = {
88
+ [P in TKey]: ZodType<TState>;
88
89
  };
89
90
  /** Helper: a single-key record mapping an action name to its Zod schema. */
90
- type ActionEntry<K extends string = string, AX extends Schema = Schema> = {
91
- [P in K]: ZodType<AX>;
91
+ type ActionEntry<TKey extends string = string, TNewActions extends Schema = Schema> = {
92
+ [P in TKey]: ZodType<TNewActions>;
92
93
  };
93
94
  /**
94
95
  * Builder interface for defining actions (commands) on a state.
@@ -96,13 +97,14 @@ type ActionEntry<K extends string = string, AX extends Schema = Schema> = {
96
97
  * Actions represent user/system intents to modify state. Each action is validated
97
98
  * against a schema, can have business rule invariants, and must emit one or more events.
98
99
  *
99
- * @template S - State schema type
100
- * @template E - Event schemas type
101
- * @template A - Action schemas type
100
+ * @template TState - State schema type
101
+ * @template TEvents - Event schemas type
102
+ * @template TActions - Action schemas type
103
+ * @template TName - State name literal type
102
104
  *
103
105
  * @see {@link state} for complete usage examples
104
106
  */
105
- export type ActionBuilder<S extends Schema, E extends Schemas, A extends Schemas, N extends string = string> = {
107
+ export type ActionBuilder<TState extends Schema, TEvents extends Schemas, TActions extends Schemas, TName extends string = string> = {
106
108
  /**
107
109
  * Defines an action (command) that can be executed on this state.
108
110
  *
@@ -114,8 +116,8 @@ export type ActionBuilder<S extends Schema, E extends Schemas, A extends Schemas
114
116
  * when the variable name matches the action name. The key becomes the
115
117
  * action name, the value the Zod schema.
116
118
  *
117
- * @template K - Action name (string literal type)
118
- * @template AX - Action payload schema type
119
+ * @template TKey - Action name (string literal type)
120
+ * @template TNewActions - Action payload schema type
119
121
  * @param entry - Single-key record `{ ActionName: schema }`
120
122
  * @returns An object with `.given()` and `.emit()` for further configuration
121
123
  *
@@ -142,7 +144,7 @@ export type ActionBuilder<S extends Schema, E extends Schemas, A extends Schemas
142
144
  * .emit((action) => ["TicketOpened", { title: action.title }])
143
145
  * ```
144
146
  */
145
- on: <K extends string, AX extends Schema>(entry: ActionEntry<K, AX>) => {
147
+ on: <TKey extends string, TNewActions extends Schema>(entry: ActionEntry<TKey, TNewActions>) => {
146
148
  /**
147
149
  * Adds business rule invariants that must hold before the action can execute.
148
150
  *
@@ -161,7 +163,7 @@ export type ActionBuilder<S extends Schema, E extends Schemas, A extends Schemas
161
163
  * ])
162
164
  * ```
163
165
  */
164
- given: (rules: Invariant<S>[]) => {
166
+ given: (rules: Invariant<TState>[]) => {
165
167
  /**
166
168
  * Defines the action handler that emits events.
167
169
  *
@@ -188,11 +190,11 @@ export type ActionBuilder<S extends Schema, E extends Schemas, A extends Schemas
188
190
  * .emit("TicketAssigned")
189
191
  * ```
190
192
  */
191
- emit: (handler: ActionHandler<S, E, {
192
- [P in K]: AX;
193
- }, K> | (keyof E & string)) => ActionBuilder<S, E, A & {
194
- [P in K]: AX;
195
- }, N>;
193
+ emit: (handler: ActionHandler<TState, TEvents, {
194
+ [P in TKey]: TNewActions;
195
+ }, TKey> | (keyof TEvents & string)) => ActionBuilder<TState, TEvents, TActions & {
196
+ [P in TKey]: TNewActions;
197
+ }, TName>;
196
198
  };
197
199
  /**
198
200
  * Defines the action handler that emits events.
@@ -225,11 +227,11 @@ export type ActionBuilder<S extends Schema, E extends Schemas, A extends Schemas
225
227
  * ])
226
228
  * ```
227
229
  */
228
- emit: (handler: ActionHandler<S, E, {
229
- [P in K]: AX;
230
- }, K> | (keyof E & string)) => ActionBuilder<S, E, A & {
231
- [P in K]: AX;
232
- }, N>;
230
+ emit: (handler: ActionHandler<TState, TEvents, {
231
+ [P in TKey]: TNewActions;
232
+ }, TKey> | (keyof TEvents & string)) => ActionBuilder<TState, TEvents, TActions & {
233
+ [P in TKey]: TNewActions;
234
+ }, TName>;
233
235
  };
234
236
  /**
235
237
  * Defines a snapshotting strategy to optimize state reconstruction.
@@ -262,7 +264,7 @@ export type ActionBuilder<S extends Schema, E extends Schemas, A extends Schemas
262
264
  * })
263
265
  * ```
264
266
  */
265
- snap: (snap: (snapshot: Snapshot<S, E>) => boolean) => ActionBuilder<S, E, A, N>;
267
+ snap: (snap: (snapshot: Snapshot<TState, TEvents>) => boolean) => ActionBuilder<TState, TEvents, TActions, TName>;
266
268
  /**
267
269
  * Finalizes and builds the state definition.
268
270
  *
@@ -279,10 +281,10 @@ export type ActionBuilder<S extends Schema, E extends Schemas, A extends Schemas
279
281
  * .patch({ Incremented: ({ data }, state) => ({ count: state.count + data.amount }) })
280
282
  * .on({ increment: z.object({ by: z.number() }) })
281
283
  * .emit((action) => ["Incremented", { amount: action.by }])
282
- * .build(); // Returns State<S, E, A, N>
284
+ * .build(); // Returns State<TState, TEvents, TActions, TName>
283
285
  * ```
284
286
  */
285
- build: () => State<S, E, A, N>;
287
+ build: () => State<TState, TEvents, TActions, TName>;
286
288
  };
287
289
  /**
288
290
  * Creates a new state definition with event sourcing capabilities.
@@ -300,7 +302,7 @@ export type ActionBuilder<S extends Schema, E extends Schemas, A extends Schemas
300
302
  * 5. Business rules (invariants) via `.given()`
301
303
  * 6. Snapshotting strategy via `.snap()`
302
304
  *
303
- * @template S - Zod schema type defining the shape of the state
305
+ * @template TState - Zod schema type defining the shape of the state
304
306
  * @param entry - Single-key record mapping state name to Zod schema (e.g., `{ Counter: z.object({ count: z.number() }) }`)
305
307
  * @returns A StateBuilder instance for fluent API configuration
306
308
  *
@@ -401,6 +403,6 @@ export type ActionBuilder<S extends Schema, E extends Schemas, A extends Schemas
401
403
  * @see {@link https://rotorsoft.github.io/act-root/docs/intro | Getting Started Guide}
402
404
  * @see {@link https://rotorsoft.github.io/act-root/docs/examples/calculator | Calculator Example}
403
405
  */
404
- export declare function state<N extends string, S extends Schema>(entry: StateEntry<N, S>): StateBuilder<S, N>;
406
+ export declare function state<TName extends string, TState extends Schema>(entry: StateEntry<TName, TState>): StateBuilder<TState, TName>;
405
407
  export {};
406
408
  //# sourceMappingURL=state-builder.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"state-builder.d.ts","sourceRoot":"","sources":["../../src/state-builder.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAC9B,OAAO,EACL,aAAa,EAGb,SAAS,EACT,aAAa,EACb,MAAM,EACN,OAAO,EACP,QAAQ,EACR,KAAK,EACL,QAAQ,EACT,MAAM,kBAAkB,CAAC;AAE1B;;;;;;;;;;GAUG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,MAAM,GAAG,MAAM,IAAI;IACtE;;;;;;;;;;;;;;;;;;OAkBG;IACH,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,QAAQ,CAAC,CAAC,CAAC,KAAK;QACjC;;;;;;;;;;;;;;;;;;WAkBG;QACH,KAAK,EAAE,CAAC,CAAC,SAAS,OAAO,EACvB,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,KAEhB,aAAa,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,GAAG;YAChC;;;;;;;;;;;;;;;;;;;eAmBG;YACH,KAAK,EAAE,CACL,KAAK,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAEhC,aAAa,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;SACjC,CAAC;KACH,CAAC;CACH,CAAC;AAEF,0EAA0E;AAC1E,KAAK,UAAU,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,EAAE,CAAC,SAAS,MAAM,GAAG,MAAM,IAAI;KACrE,C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