
This is a rather large commit that includes all of the following: - React UI with code editor, runtime renderer and input-output panes - Language providers for a sample language and Brainfuck - Implementation of code execution in a web worker - All-at-once unabortable execution of program fully functional
24 lines
482 B
TypeScript
24 lines
482 B
TypeScript
import { StepExecutionResult } from "./types";
|
|
|
|
export type WorkerRequestData =
|
|
| {
|
|
type: "Init";
|
|
params?: null;
|
|
}
|
|
| {
|
|
type: "Reset";
|
|
params?: null;
|
|
}
|
|
| {
|
|
type: "Prepare";
|
|
params: { code: string; input: string };
|
|
}
|
|
| {
|
|
type: "Execute";
|
|
params: { interval?: number };
|
|
};
|
|
|
|
export type WorkerResponseData<RS> =
|
|
| { type: "state"; data: "empty" | "ready" }
|
|
| { type: "result"; data: StepExecutionResult<RS> };
|