Interface KosStateGuardOptions<TState>

Options for

Kos State Guard

decorator.

interface KosStateGuardOptions<TState> {
    allowedStates: TState[];
    throwOnInvalid?: boolean;
}

Type Parameters

  • TState extends string

Properties

allowedStates: TState[]

Array of states in which the decorated method can be called. The method will throw an error (or log a warning) if called from any other state.

throwOnInvalid?: boolean

Whether to throw an error on invalid state. When false, logs a warning instead.

Default

true (uses the FSM's throwOnInvalid setting)