@mudssky/jsutils
    Preparing search index...

    Interface MachineTransitionConfig<TValue, TContext, TEvent, TType>

    单条事件转移配置。

    interface MachineTransitionConfig<
        TValue extends string,
        TContext,
        TEvent extends { type: string },
        TType extends TEvent["type"] = TEvent["type"],
    > {
        assign?: (
            args: MachineTransitionArgs<
                TValue,
                TContext,
                ExtractMachineEvent<TEvent, TType>,
            >,
        ) => TContext | Partial<TContext>;
        guard?: (
            args: MachineTransitionArgs<
                TValue,
                TContext,
                ExtractMachineEvent<TEvent, TType>,
            >,
        ) => boolean;
        target: TValue;
    }

    Type Parameters

    • TValue extends string

      状态值字面量联合类型

    • TContext

      上下文对象类型

    • TEvent extends { type: string }

      事件联合类型

    • TType extends TEvent["type"] = TEvent["type"]

      当前配置对应的事件类型字面量

    Index

    Properties

    Properties

    assign?: (
        args: MachineTransitionArgs<
            TValue,
            TContext,
            ExtractMachineEvent<TEvent, TType>,
        >,
    ) => TContext | Partial<TContext>
    guard?: (
        args: MachineTransitionArgs<
            TValue,
            TContext,
            ExtractMachineEvent<TEvent, TType>,
        >,
    ) => boolean
    target: TValue