Type Alias Exact<D, G, E>

Exact<D, G, E>: {
    console?: ConsoleInterface;
    effects?: {
        readonly [N in E]: IsStringLiteral<N> extends false
            ? "Error: Effect name must be a literal string."
            : N extends ReservedKeyword
                ? `Error: Effect name '${N}' is reserved.`
                : Config.Effect<D, N>
    };
    guards?: {
        readonly [N in G]: IsStringLiteral<N> extends false
            ? "Error: Guard name must be a literal string."
            : N extends ReservedKeyword
                ? `Error: Guard name '${N}' is reserved.`
                : Config.Guard<D, N>
    };
    verbose?: Verbose;
}

The type of state machine configuration.

Type Parameters

  • D

    The type of definition for state machine.

  • G extends string

    The type of guard names for state machine.

  • E extends string

    The type of effect names for state machine.

Type declaration

  • Optional Readonlyconsole?: ConsoleInterface

    Interface for a console object.

    console
    
  • Optional Readonlyeffects?: {
        readonly [N in E]: IsStringLiteral<N> extends false
            ? "Error: Effect name must be a literal string."
            : N extends ReservedKeyword
                ? `Error: Effect name '${N}' is reserved.`
                : Config.Effect<D, N>
    }

    The actions to perform when the state is entered.

  • Optional Readonlyguards?: {
        readonly [N in G]: IsStringLiteral<N> extends false
            ? "Error: Guard name must be a literal string."
            : N extends ReservedKeyword
                ? `Error: Guard name '${N}' is reserved.`
                : Config.Guard<D, N>
    }

    The guards to check before the transition.

  • Optional Readonlyverbose?: Verbose

    The verbose level to log messages.

    • 0 or false: No logs.
    • 1: Error messages only.
    • 2 or true: All messages.
    1