Restructure LiveAtlasServerDefinition
This commit is contained in:
parent
e61d0def04
commit
355c0c71cf
11
src/index.d.ts
vendored
11
src/index.d.ts
vendored
@ -41,13 +41,10 @@ interface LiveAtlasGlobalConfig {
|
||||
}
|
||||
|
||||
interface LiveAtlasServerDefinition {
|
||||
id: string
|
||||
label?: string
|
||||
}
|
||||
|
||||
interface LiveAtlasDynmapServerDefinition extends LiveAtlasServerDefinition {
|
||||
type: 'dynmap',
|
||||
dynmap: DynmapUrlConfig,
|
||||
id: string;
|
||||
label?: string;
|
||||
type: 'dynmap'
|
||||
dynmap: DynmapUrlConfig;
|
||||
}
|
||||
|
||||
// Messages defined directly in LiveAtlas and used for all servers
|
||||
|
@ -19,7 +19,6 @@ import {
|
||||
LiveAtlasArea,
|
||||
LiveAtlasCircle,
|
||||
LiveAtlasDimension,
|
||||
LiveAtlasDynmapServerDefinition,
|
||||
LiveAtlasLine,
|
||||
LiveAtlasMarker,
|
||||
LiveAtlasMarkerSet,
|
||||
@ -51,8 +50,8 @@ export default class DynmapMapProvider extends MapProvider {
|
||||
private updateTimestamp: Date = new Date();
|
||||
private updateInterval: number = 3000;
|
||||
|
||||
constructor(config: LiveAtlasDynmapServerDefinition) {
|
||||
super(config as LiveAtlasServerDefinition);
|
||||
constructor(config: LiveAtlasServerDefinition) {
|
||||
super(config);
|
||||
}
|
||||
|
||||
private static buildServerConfig(response: any): DynmapServerConfig {
|
||||
|
@ -34,11 +34,10 @@ import {
|
||||
LiveAtlasGlobalConfig,
|
||||
LiveAtlasGlobalMessageConfig,
|
||||
LiveAtlasServerMessageConfig,
|
||||
LiveAtlasDynmapServerDefinition,
|
||||
LiveAtlasPlayer,
|
||||
LiveAtlasCircle,
|
||||
LiveAtlasLine,
|
||||
LiveAtlasArea, LiveAtlasMarker, LiveAtlasMarkerSet
|
||||
LiveAtlasArea, LiveAtlasMarker, LiveAtlasMarkerSet, LiveAtlasServerDefinition
|
||||
} from "@/index";
|
||||
import DynmapMapProvider from "@/providers/DynmapMapProvider";
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import {LiveAtlasDynmapServerDefinition, LiveAtlasGlobalConfig, LiveAtlasServerDefinition} from "@/index";
|
||||
import {LiveAtlasGlobalConfig, LiveAtlasServerDefinition} from "@/index";
|
||||
import ConfigurationError from "@/errors/ConfigurationError";
|
||||
import {DynmapUrlConfig} from "@/dynmap";
|
||||
|
||||
@ -64,7 +64,7 @@ const validateLiveAtlasConfiguration = (config: any): Map<string, LiveAtlasServe
|
||||
return result;
|
||||
};
|
||||
|
||||
const validateDynmapConfiguration = (config: DynmapUrlConfig): Map<string, LiveAtlasDynmapServerDefinition> => {
|
||||
const validateDynmapConfiguration = (config: DynmapUrlConfig): Map<string, LiveAtlasServerDefinition> => {
|
||||
const check = '\nCheck your standalone/config.js file exists and is being loaded correctly.';
|
||||
|
||||
if (!config) {
|
||||
@ -91,7 +91,7 @@ const validateDynmapConfiguration = (config: DynmapUrlConfig): Map<string, LiveA
|
||||
throw new ConfigurationError(`Dynmap sendmessage URL is missing. ${check}`);
|
||||
}
|
||||
|
||||
const result = new Map<string, LiveAtlasDynmapServerDefinition>();
|
||||
const result = new Map<string, LiveAtlasServerDefinition>();
|
||||
result.set('dynmap', {
|
||||
id: 'dynmap',
|
||||
label: 'dynmap',
|
||||
|
Loading…
Reference in New Issue
Block a user