@@ -14,15 +14,23 @@ import type { Schedule } from "./schedule";
1414 * @typeParam A Actor this action belongs to
1515 */
1616export class ActionContext <
17- S ,
18- CP ,
19- CS ,
20- V ,
21- I ,
22- AD ,
23- DB extends AnyDatabaseProvider ,
17+ TState ,
18+ TConnParams ,
19+ TConnState ,
20+ TVars ,
21+ TInput ,
22+ TAuthData ,
23+ TDatabase extends AnyDatabaseProvider ,
2424> {
25- #actorContext: ActorContext < S , CP , CS , V , I , AD , DB > ;
25+ #actorContext: ActorContext <
26+ TState ,
27+ TConnParams ,
28+ TConnState ,
29+ TVars ,
30+ TInput ,
31+ TAuthData ,
32+ TDatabase
33+ > ;
2634
2735 /**
2836 * Should not be called directly.
@@ -31,23 +39,39 @@ export class ActionContext<
3139 * @param conn - The connection associated with the action
3240 */
3341 constructor (
34- actorContext : ActorContext < S , CP , CS , V , I , AD , DB > ,
35- public readonly conn : Conn < S , CP , CS , V , I , AD , DB > ,
42+ actorContext : ActorContext <
43+ TState ,
44+ TConnParams ,
45+ TConnState ,
46+ TVars ,
47+ TInput ,
48+ TAuthData ,
49+ TDatabase
50+ > ,
51+ public readonly conn : Conn <
52+ TState ,
53+ TConnParams ,
54+ TConnState ,
55+ TVars ,
56+ TInput ,
57+ TAuthData ,
58+ TDatabase
59+ > ,
3660 ) {
3761 this . #actorContext = actorContext ;
3862 }
3963
4064 /**
4165 * Get the actor state
4266 */
43- get state ( ) : S {
67+ get state ( ) : TState {
4468 return this . #actorContext. state ;
4569 }
4670
4771 /**
4872 * Get the actor variables
4973 */
50- get vars ( ) : V {
74+ get vars ( ) : TVars {
5175 return this . #actorContext. vars ;
5276 }
5377
@@ -103,7 +127,10 @@ export class ActionContext<
103127 /**
104128 * Gets the map of connections.
105129 */
106- get conns ( ) : Map < ConnId , Conn < S , CP , CS , V , I , AD , DB > > {
130+ get conns ( ) : Map <
131+ ConnId ,
132+ Conn < TState , TConnParams , TConnState , TVars , TInput , TAuthData , TDatabase >
133+ > {
107134 return this . #actorContext. conns ;
108135 }
109136
@@ -117,7 +144,7 @@ export class ActionContext<
117144 /**
118145 * @experimental
119146 */
120- get db ( ) : InferDatabaseClient < DB > {
147+ get db ( ) : InferDatabaseClient < TDatabase > {
121148 return this . #actorContext. db ;
122149 }
123150
0 commit comments