Type Alias Transition<D, G, _T>

Transition<D, G, _T>: [_T] extends [never]
    ? "Error: State values are not defined."
    : IsStringLiteral<_T> extends false
        ? "Error: State values must be literal strings."
        : Extends<_T, ReservedKeyword> extends true
            ? `Error: State value '${Extract<_T, string>}' is reserved.`
            : _T | {
                guard?: [G] extends [never]
                    ? "Error: Guards are not defined."
                    : IsStringLiteral<G> extends false
                        ? "Error: Guards must be literal strings."
                        : Extends<G, ReservedKeyword> extends true
                            ? `Error: Guard name '${G}' is reserved.`
                            : Definition.Guard<G>;
                target: _T;
            }

The type of transition for state machine.

Type Parameters

  • D

    The type of definition for state machine.

  • G extends string

    The type of guards for state machine functions.

  • _T = keyof Get<D, ["states"]>

    (internal) The type of state value.