import StateChangeKind from "./StateChangeKind"; /** * Represents a single state mutation ready for persistence. * * ActorStateChange encapsulates a state modification that is ready to be sent to the * state provider for persistence. It combines the state key, the new value, and the * type of modification (add, update, or remove). * * These objects are created during the transactional batch process by ActorStateManager * and are sent to StateProvider for atomic persistence through the Dapr state management API. * * @typeParam T - The type of the state value. * * @internal Used by ActorStateManager and StateProvider for transactional persistence. */ export default class ActorStateChange { private readonly stateName; private readonly value; private readonly changeKind; /** * Constructs an ActorStateChange. * * @param stateName - The key identifying this state item. * @param value - The new value to persist (or null for removes). * @param changeKind - The type of modification ({@link StateChangeKind}). */ constructor(stateName: string, value: T, changeKind: StateChangeKind); /** * Retrieves the state key. * * @returns The key identifying this state item. */ getStateName(): string; /** * Retrieves the state value to be persisted. * * @returns The new state value (or null for removes). */ getValue(): T; /** * Retrieves the kind of modification. * * @returns The {@link StateChangeKind} (ADD, UPDATE, or REMOVE). */ getChangeKind(): StateChangeKind; }