Computer/src/ui/uiComponent.ts
2024-02-23 01:37:12 -05:00

20 lines
535 B
TypeScript

/**
* @file Definition of what a UI component is in the context of this program
* @copyright Alexander Bass 2024
* @license GPL-3.0
*/
import { CpuEventHandler, UiEventHandler } from "../events";
export interface UiComponent {
element: HTMLElement;
/** Allows listening and emitting UiEvent's*/
events: UiEventHandler;
reset: () => void;
/** Allows listening CPUEvent's*/
init_cpu_events: (c: CpuEventHandler) => void;
}
export interface UiComponentConstructor {
new (el: HTMLElement, ue: UiEventHandler): UiComponent;
}