begin implementing mechanism of declaring 'Plant' (e.g., digital watch, microwave oven) to simulate a plant interactively

This commit is contained in:
Joeri Exelmans 2025-10-21 14:51:14 +02:00
parent 97d42c1cef
commit 0da2c793cd
2 changed files with 52 additions and 0 deletions

11
src/Plant/Plant.ts Normal file
View file

@ -0,0 +1,11 @@
import { EventTrigger } from "@/statecharts/label_ast";
import { RaisedEvent } from "@/statecharts/runtime_types";
import { ReactElement } from "react";
export type Plant<StateType> = {
inputEvents: EventTrigger[];
outputEvents: EventTrigger[];
reducer: (inputEvent: RaisedEvent, state: StateType) => StateType;
render: (state: StateType) => ReactElement;
}