UNPKG

fsmgasm-js

Version:

Port of FSMgasm by Minikloon for JS

56 lines (48 loc) 1.22 kB
declare class State { #private; started: boolean; ended: boolean; frozen: boolean; constructor(); start(): void; onStart(): void; update(): void; onUpdate(): void; end(): void; onEnd(): void; isReadyToEnd(): boolean; } declare class StateConditional extends State { constructor(condition: () => (boolean)); } declare class StateHolder extends State { states: State[]; constructor(); add(state: State): void; addAll(states: State[]): void; } declare class StateGroup extends StateHolder { constructor(); onUpdate(): void; isReadyToEnd(): boolean; } declare class StateSeries extends StateHolder { #private; constructor(); onUpdate(): void; currentState(): State; isReadyToEnd(): boolean; } declare class StateProxy extends StateSeries { createStates: () => (State[]); constructor(createStates: () => (State[])); onStart(): void; } declare class StateSwitch extends State { currentState: State; constructor(); changeState(state: State): void; onUpdate(): void; isReadyToEnd(): boolean; } export { State, StateConditional, StateGroup, StateHolder, StateProxy, StateSeries, StateSwitch };