fix types for GlobalModel / GlobalCommandRunner so references work

This commit is contained in:
sawka 2024-02-11 15:34:31 -03:00
parent 2a4d85430a
commit 07abaa92fa
3 changed files with 4 additions and 4 deletions

View File

@ -8,7 +8,7 @@ import { GlobalModel } from "./global";
class CommandRunner {
private constructor() {}
static getInstance() {
static getInstance(): CommandRunner {
if (!(window as any).GlobalCommandRunner) {
(window as any).GlobalCommandRunner = new CommandRunner();
}

View File

@ -1,6 +1,6 @@
import { Model } from "./model";
import { CommandRunner } from "./commandrunner";
const GlobalModel = Model.getInstance();
const GlobalCommandRunner = CommandRunner.getInstance();
const GlobalModel: Model = Model.getInstance();
const GlobalCommandRunner: CommandRunner = CommandRunner.getInstance();
export { GlobalModel, GlobalCommandRunner };

View File

@ -241,7 +241,7 @@ class Model {
setTimeout(() => this.getClientDataLoop(1), 10);
}
static getInstance() {
static getInstance(): Model {
if (!(window as any).GlobalModel) {
(window as any).GlobalModel = new Model();
}