mirror of
https://github.com/felixrieseberg/windows95.git
synced 2026-05-09 16:31:58 +00:00
React 19, Electron 41, TypeScript 6, electron-forge 7.8, plus everything else to latest. Migrated to React 19 createRoot API, updated for Electron 41 session/window type changes, and adjusted tsconfig for TS 6 deprecations. Regenerated @electron/packager patch for 18.4.4.
43 lines
912 B
TypeScript
43 lines
912 B
TypeScript
export interface Win95Window extends Window {
|
|
emulator: any;
|
|
win95: {
|
|
app: App;
|
|
};
|
|
}
|
|
|
|
declare let window: Win95Window;
|
|
|
|
/**
|
|
* The top-level class controlling the whole app. This is *not* a React component,
|
|
* but it does eventually render all components.
|
|
*
|
|
* @class App
|
|
*/
|
|
export class App {
|
|
/**
|
|
* Initial setup call, loading Monaco and kicking off the React
|
|
* render process.
|
|
*/
|
|
public async setup(): Promise<void> {
|
|
const React = await import("react");
|
|
const { createRoot } = await import("react-dom/client");
|
|
const { Emulator } = await import("./emulator");
|
|
|
|
const className = `${process.platform}`;
|
|
const app = (
|
|
<div className={className}>
|
|
<Emulator />
|
|
</div>
|
|
);
|
|
|
|
const root = createRoot(document.getElementById("app")!);
|
|
root.render(app);
|
|
}
|
|
}
|
|
|
|
window.win95 = window.win95 || {
|
|
app: new App(),
|
|
};
|
|
|
|
window.win95.app.setup();
|