Type Alias GuardMapping<Context, G, States>

GuardMapping: {
    guard: G extends Guard<Context, infer K> ? K : never;
    target: States;
}

This is a mapping of a guard to a target state.

Generic parameters:

  • Context: The context of the state machine. (which can be used by each state to do calculations that would persist across states)
  • G: The guard type.
  • States: All of the possible states that the state machine can be in. e.g. a string literal union like "IDLE" | "SELECTING" | "PAN" | "ZOOM"

You probably don't need to use this type directly.

Type Parameters

Type declaration