Helper Types
ActorCore provides several TypeScript helper types to make it easier to work with actors in a type-safe way.
Context
Types
When working with actors, you often need to access the context object. ActorCore provides helper types to extract the context types from actor definitions.
ActorContextOf<ActorDefinition>
Extracts the full actor context type from an actor definition. This is the type of the context object (c
) available in lifecycle hooks such as onCreate
, onStart
, etc.
ActionContextOf<ActorDefinition>
Extracts the action context type from an actor definition. This is the type of the context object (c
) available in action handlers.