diff --git a/core/fsm/src/core.ts b/core/fsm/src/core.ts index 44331c059..d8418942b 100644 --- a/core/fsm/src/core.ts +++ b/core/fsm/src/core.ts @@ -12,7 +12,7 @@ import type { FsmTypeHelper, SignalConfig, } from './type.js'; -import type {OmitFirstParam, SingleOrArray, StringifyableRecord} from '@alwatr/type'; +import type {MaybePromise, OmitFirstParam, SingleOrArray, StringifyableRecord} from '@alwatr/type'; globalAlwatr.registeredList.push({ name: '@alwatr/fsm', @@ -199,7 +199,7 @@ export const _execAction = ( constructor: FsmConstructor, actionNames: SingleOrArray | undefined, finiteStateMachine: FsmConsumerInterface, -): boolean | void => { +): boolean | MaybePromise => { if (actionNames == null) return; logger.logMethodArgs('execAction', {constructorId: constructor.id, actionNames}); diff --git a/core/fsm/src/type.ts b/core/fsm/src/type.ts index d6b7b17e4..4270f8751 100644 --- a/core/fsm/src/type.ts +++ b/core/fsm/src/type.ts @@ -1,6 +1,6 @@ import type {finiteStateMachineConsumer} from './core.js'; import type {DebounceType} from '@alwatr/signal'; -import type {ArrayItems, SingleOrArray, StringifyableRecord} from '@alwatr/type'; +import type {ArrayItems, MaybePromise, SingleOrArray, StringifyableRecord} from '@alwatr/type'; export interface FsmConstructor { /** @@ -107,7 +107,7 @@ export interface FsmInstance< } export type ActionRecord = { - readonly [P in T['TActionName']]?: (finiteStateMachine: FsmConsumerInterface) => void | boolean; + readonly [P in T['TActionName']]?: (finiteStateMachine: FsmConsumerInterface) => MaybePromise | boolean; }; export type SignalConfig = {