Use an enum for server platforms
This commit is contained in:
parent
baac1391ee
commit
d834badb78
@ -25,7 +25,7 @@ export const getMinecraftServer = (
|
||||
platform: Platform,
|
||||
hostname: string
|
||||
): Promise<CachedJavaMinecraftServer | CachedBedrockMinecraftServer> =>
|
||||
platform === "java"
|
||||
platform === Platform.Java
|
||||
? new WebRequest(
|
||||
`/server/${platform}/${hostname}`
|
||||
).execute<CachedJavaMinecraftServer>()
|
||||
|
12
JS-SDK/src/types/server.d.ts
vendored
12
JS-SDK/src/types/server.d.ts
vendored
@ -112,7 +112,17 @@ export type MOTD = {
|
||||
* A platform a Minecraft
|
||||
* server can operate on.
|
||||
*/
|
||||
export type Platform = "java" | "bedrock";
|
||||
export enum Platform {
|
||||
/**
|
||||
* The Java edition of Minecraft.
|
||||
*/
|
||||
Java,
|
||||
|
||||
/**
|
||||
* The Bedrock edition of Minecraft.
|
||||
*/
|
||||
Bedrock,
|
||||
}
|
||||
|
||||
/**
|
||||
* Types of a DNS record.
|
||||
|
Loading…
Reference in New Issue
Block a user