More
Helper Types
Rivet 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. Rivet provides helper types to extract the context types from actor definitions.
ActorContextOf<ActorDefinition>
Extracts the full actor context type from a actor definition. This is the type of the context object (c
) available in lifecycle hooks such as onCreate
, onStart
, etc.
TypeScript
ActionContextOf<ActorDefinition>
Extracts the action context type from a actor definition. This is the type of the context object (c
) available in action handlers.
TypeScript