{
}
this.goban = createGoban(opts);
this.goban.setMode("puzzle");
- (window as any)["global_goban"] = this.goban;
+ window.global_goban = this.goban;
this.goban.on("update", () => this.onUpdate());
this.goban.on("puzzle-wrong-answer", this.onWrongAnswer);
diff --git a/src/views/SignIn/SignIn.tsx b/src/views/SignIn/SignIn.tsx
index a1a781e2b9..2187c3587d 100644
--- a/src/views/SignIn/SignIn.tsx
+++ b/src/views/SignIn/SignIn.tsx
@@ -29,7 +29,7 @@ import { useUser } from "@/lib/hooks";
import { SocialLoginButtons } from "@/components/SocialLoginButtons";
-(window as any)["Md5"] = Md5;
+window.Md5 = Md5;
import { alert } from "@/lib/swal_config";
import { LoadingButton } from "@/components/LoadingButton";
diff --git a/src/views/Supporter/Supporter.tsx b/src/views/Supporter/Supporter.tsx
index f5494b469e..079031b87c 100644
--- a/src/views/Supporter/Supporter.tsx
+++ b/src/views/Supporter/Supporter.tsx
@@ -154,7 +154,7 @@ function load_checkout_libraries(): void {
script.async = true;
//script.charset = "utf-8";
script.onload = () => {
- (window as any)["stripe"] = stripe = new Stripe(data.get("config")?.stripe_pk);
+ window.stripe = stripe = new Stripe(data.get("config")?.stripe_pk);
resolve();
};
script.onerror = () => {
diff --git a/src/views/Tournament/Tournament.tsx b/src/views/Tournament/Tournament.tsx
index 21912f3c07..ffa1d645ef 100644
--- a/src/views/Tournament/Tournament.tsx
+++ b/src/views/Tournament/Tournament.tsx
@@ -852,7 +852,7 @@ export function Tournament(): JSX.Element {
}
};
- (window as any)["tournament"] = tournament;
+ window.tournament = tournament;
let tournament_time_start_text = "";
if (tournament.time_start) {
@@ -2631,7 +2631,7 @@ function OpenGothaRoster({
tournament: TournamentInterface;
players: TournamentPlayer[];
}): JSX.Element {
- (window as any)["players"] = players;
+ window.players = players;
players.sort((a, b) => a.username.localeCompare(b.username));
return (
@@ -2674,7 +2674,7 @@ function OpenGothaTournamentRound({
const [notes, _set_notes]: [string, (s: string) => void] = React.useState(roundNotes);
const [notes_updated, set_notes_updated]: [boolean, (b: boolean) => void] =
React.useState(false);
- (window as any)["rounds"] = rounds;
+ window.rounds = rounds;
const round_started = !!(
rounds.length >= selectedRound && (rounds[selectedRound - 1]?.matches.length || 0) > 0
);
diff --git a/src/views/TournamentRecord/TournamentRecord.tsx b/src/views/TournamentRecord/TournamentRecord.tsx
index d00da78151..93a25d5e5e 100644
--- a/src/views/TournamentRecord/TournamentRecord.tsx
+++ b/src/views/TournamentRecord/TournamentRecord.tsx
@@ -26,7 +26,7 @@ import { ignore, errorAlerter, dup } from "@/lib/misc";
import { rankString, allRanks } from "@/lib/rank_utils";
import { createDemoBoard } from "@/components/ChallengeModal";
-(window as any)["dup"] = dup;
+window.dup = dup;
import { alert } from "@/lib/swal_config";
const ranks = allRanks();
diff --git a/typings_manual/index.d.ts b/typings_manual/index.d.ts
index 4197db68b9..5b904ec253 100644
--- a/typings_manual/index.d.ts
+++ b/typings_manual/index.d.ts
@@ -1 +1,56 @@
///
+
+interface Window {
+ global_goban?: import("goban").GobanRenderer | null;
+ // TODO: dedupe with global_goban
+ goban?: import("goban").GobanRenderer | null;
+
+ // Set in index.html
+ cdn_service: string;
+ default_theme: string;
+ ogs_release: string;
+ ogs_current_language: string;
+
+ // Set by translation files
+ ogs_locales: Record>>;
+ ogs_countries: Record>
+
+ // Set by gulp
+ websocket_host: string;
+
+ // set in main.tsx
+ user: unknown;
+ data: unknown;
+ preferences: unknown;
+ player_cache: unknown;
+ requests: unknown;
+
+ debug: unknown; // debug.ts
+ socket: unknown; // socket.ts
+
+ // These seem to be part of some very specific debugging. Can any be removed?
+ mini_goban?: import("goban").GobanRenderer; // MiniGoban
+ dup: Function; // TournamentRecord.tsx
+ rounds?: unknown; // Tournament.tsx
+ players?: unknown; // Tournament.tsx
+ tournament?: unknown; // Tournament.tsx
+ file?: unknown; // image_resizer.ts
+ browserHistory: unknown; // ogsHistory.ts
+ report_manager: unknown; // report_manager.ts
+ sfx: unknown; // sfx.ts
+ sprite_packs: unknown; // sfx.ts
+ swal: unknown; // swal.ts
+ toast: Function; // toast.tsx
+ aireview?: unknown; // AIReview.tsx
+ stripe?: unknown; // Supporter.tsx
+ Md5: unknown; // SignIn.tsx
+ Game?: null; // Game.tsx
+ GobanThemes: unknown; // configure-goban.ts
+ GobanEngine: unknown; // configure-goban.ts
+ skew_clock: Function; // misc.ts
+ notification_manager?: unknown; // NotificationManager.tsx
+ test_sentry: Function; // ErrorBoundary.tsx
+ proxy?: unknown; // ChatUserList.tsx
+
+ safari?: unknown;
+}
\ No newline at end of file