From a27f8fab35d399a09160f21b70a8131a6f4b3caa Mon Sep 17 00:00:00 2001 From: Markus Felten Date: Mon, 12 Feb 2024 12:51:56 +0000 Subject: [PATCH] feat: provide types --- src/statetransition-mixin.mjs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/statetransition-mixin.mjs b/src/statetransition-mixin.mjs index e00837fc..55f10202 100644 --- a/src/statetransition-mixin.mjs +++ b/src/statetransition-mixin.mjs @@ -17,6 +17,7 @@ const TRANSITION_PROMISE = Symbol("transitionPromise"); /** * @typedef {Object} Transition * @property {number} timeout in milliseconds the transtion is allowed to take + * @property {string} name * @property {Transition} initial to begin with * @property {Transition} during while we are trying to reach the target * @property {Transition} target @@ -97,7 +98,7 @@ export function prepareActions(as) { /** * Extends a class to support state transtions. - * @param {Class} superclass + * @param {new() => superclass} superclass * @param {Action[]} actions * @param {string} initialState starting state */ @@ -159,7 +160,7 @@ export function StateTransitionMixin(superclass, actions, initialState) { * @param {string} newState new state * @return {void} */ - stateChanged() {} + stateChanged(origin,oldState,newState) {} /** * Delivers current state