From 07abaa92fae9b545ede401bd82ce402df7fd9054 Mon Sep 17 00:00:00 2001 From: sawka Date: Sun, 11 Feb 2024 15:34:31 -0300 Subject: [PATCH] fix types for GlobalModel / GlobalCommandRunner so references work --- src/models/commandrunner.ts | 2 +- src/models/global.ts | 4 ++-- src/models/model.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/models/commandrunner.ts b/src/models/commandrunner.ts index 2140a784e..009b62b52 100644 --- a/src/models/commandrunner.ts +++ b/src/models/commandrunner.ts @@ -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(); } diff --git a/src/models/global.ts b/src/models/global.ts index 91c263260..1bde77153 100644 --- a/src/models/global.ts +++ b/src/models/global.ts @@ -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 }; diff --git a/src/models/model.ts b/src/models/model.ts index af73dea5d..8f4ad6ed9 100644 --- a/src/models/model.ts +++ b/src/models/model.ts @@ -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(); }