Type alias EventWriteRequest<Context, AuthContext, EventShape, StateShape>

EventWriteRequest<Context, AuthContext, EventShape, StateShape>: {
    authContext: AuthContext;
    context: Context;
    event: EventShape;
    machineInstanceName: string;
    state: StateShape;
    type: "event";
}

A request to send an event to the machine instance.

Use EventWriteRequest<Context, AuthContext, EventShape, StateShape> to specify the types of the state, context and events for your machine and the authContext you will provide.

Type Parameters

Type declaration

  • authContext: AuthContext

    The authorization context of the reader requesting access to the machine instance.

    The authorization context is the act claim of the JWT used to authenticate the reader (with the top-level sub claim used as a fallback if act did not provide a sub)

  • context: Context

    The context of the machine instance.

  • event: EventShape

    The event that the requester wants to send to the machine instance.

  • machineInstanceName: string

    The name of the machine instance to read.

    This is the name you provided when you created the machine instance.

  • state: StateShape

    The current state of the machine instance.

    If the machine is in a single top-level state, this is the name of that state. If the machine is in a nested state, this is an object with the name of the parent state as the key and the name of the child state as the value. If the machine is in a parallel state, there will be multiple keys and values.

    Identical to the state.value property of an XState state.

  • type: "event"

Generated using TypeDoc