Add types for variables on global scope. (!398)
Adds a type definition for the variables added to the global scope.
Personally i'd probably stick them in an object off the route and drop the G_prefix but didn't want to make any major changes with no reason.
Reviewed-on: https://dev.sp-tarkov.com/SPT/Server/pulls/398
Co-authored-by: Alex McAuliffe <alex@romanx.co.uk>
Co-committed-by: Alex McAuliffe <alex@romanx.co.uk>
(cherry picked from commit 18d39224a9
)
This commit is contained in:
parent
68e24fc8fd
commit
9e9baf49b3
14
project/src/global.d.ts
vendored
Normal file
14
project/src/global.d.ts
vendored
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
export type {};
|
||||||
|
|
||||||
|
declare global {
|
||||||
|
var G_DEBUG_CONFIGURATION: boolean;
|
||||||
|
var G_RELEASE_CONFIGURATION: boolean;
|
||||||
|
var G_MODS_ENABLED: boolean;
|
||||||
|
var G_MODS_TRANSPILE_TS: boolean;
|
||||||
|
var G_LOG_REQUESTS: boolean;
|
||||||
|
var G_WATERMARK_ENABLED: boolean;
|
||||||
|
|
||||||
|
var G_SPTVERSION: string;
|
||||||
|
var G_COMMIT: string;
|
||||||
|
var G_BUILDTIME: number;
|
||||||
|
}
|
@ -16,7 +16,7 @@ globalThis.G_WATERMARK_ENABLED = false;
|
|||||||
|
|
||||||
globalThis.G_SPTVERSION = "";
|
globalThis.G_SPTVERSION = "";
|
||||||
globalThis.G_COMMIT = "";
|
globalThis.G_COMMIT = "";
|
||||||
globalThis.G_BUILDTIME = "";
|
globalThis.G_BUILDTIME = 0;
|
||||||
|
|
||||||
const program = new Program();
|
const program = new Program();
|
||||||
program.start();
|
program.start();
|
||||||
|
Loading…
Reference in New Issue
Block a user