Skip to content

Commit

Permalink
Move server/'s global variables out of index.ts (#7585)
Browse files Browse the repository at this point in the history
  • Loading branch information
AnnikaCodes committed Oct 26, 2020
1 parent 317779e commit c55c741
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
17 changes: 12 additions & 5 deletions server/global-variables.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,23 @@ import {Tournaments as TournamentsType} from './tournaments';
declare global {
namespace NodeJS {
interface Global {
Dex: any;
toID: (item: any) => ID;
IPTools: any;
Config: any;
Chat: any;
Tournaments: any;
Dex: any;
IPTools: any;
Ladders: any;
LoginServer: any;
Monitor: any;
nodeOomHeapdump: any;
Punishments: any;
Rooms: any;
Sockets: any
TeamValidator: any;
Monitor: any;
TeamValidatorAsync: any;
Tournaments: any;
Users: any;
Verifier: any;
toID: (item: any) => ID;
__version: {head: string, origin?: string, tree?: string};
}
}
Expand Down
3 changes: 0 additions & 3 deletions server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,6 @@ import {FS} from '../lib/fs';
* Load configuration
*********************************************************/

// global becomes much easier to use if declared as an object
declare const global: any;

import * as ConfigLoader from './config-loader';
global.Config = ConfigLoader.Config;

Expand Down

0 comments on commit c55c741

Please sign in to comment.