ds4/spec/setup.ts

28 lines
577 B
TypeScript
Raw Normal View History

2022-02-13 18:34:03 +01:00
// SPDX-FileCopyrightText: 2022 Johannes Loher
//
// SPDX-License-Identifier: MIT
import en from "../lang/en.json";
function setupStubs() {
class StubGame {
constructor() {
this.i18n = {
localize: (key: string) => (key in en ? en[key as keyof typeof en] : key),
};
}
i18n: {
localize: (key: string) => string;
};
}
const game = new StubGame();
Object.defineProperties(globalThis, {
game: { value: game },
Game: { value: StubGame },
});
}
setupStubs();