Started refactor to use typescript

This commit is contained in:
Daniel Vestøl committed 2019-03-10 14:22:08 +01:00
1 parent 9f3978e0b5
commit a4ee6f82cb
16 files changed
+264 -264

No files matched your search

+39
View File
@@ -0,0 +1,39 @@
type ClusterioConfig = {
factorioDirectory: string,
instanceDirectory: string,
databaseDirectory: string,
publicIP: string,
masterIP: string,
masterPort: number,
sslPort: number,
sslCert: string,
sslPrivKey: string,
masterAuthToken: string,
masterAuthSecret: string,
username: string,
token: string,
factorio_version: string,
verify_user_identity: boolean,
auto_pause: boolean,
allow_commands: "admins-only" | "true" | "false",
game_password: string,
description: string,
visibility: {
public: boolean,
lan: boolean
},
itemStats: {
maxEntries: number,
entriesPerSecond: number
},
logItemTransfers: boolean,
disableFairItemDistribution: boolean,
uploadModsToMaster: boolean,
msBetweenCommands: 10,
allowRemoteCommandExecution: boolean,
enableCrossServerShout: boolean,
mirrorAllChat: boolean,
autosaveInterval: 600000,
disablePrometheusPushgateway: boolean,
disableImportsOfEverythingExceptElectricity: boolean
}
+4
View File
@@ -0,0 +1,4 @@
type Mod = {
modName: string,
hash: string,
}
+3
View File
@@ -0,0 +1,3 @@
interface Request {
route: {[name: string]: any}
}
+15
View File
@@ -0,0 +1,15 @@
interface Slave {
time?: string,
rconPort?: string,
rconPassword?: string,
serverPort?: string,
unique?: string, // this one isn't really optional, but I got tired of fighting with types and rewriting logic in master.ts
publicIP?: string,
mods?: Mod[],
instanceName?: string,
playerCount?: string | number,
mac?: string,
meta?: {
[name:string]:any,
},
}
+3
View File
@@ -0,0 +1,3 @@
type Slaves = {
[name: string]: Slave,
}
+6
View File
@@ -0,0 +1,6 @@
type item = {
name: string,
count: number,
instanceName?: string,
instanceID?: string,
}