earthmc
Version:
An unofficial EarthMC library providing handy methods and extensive info.
91 lines • 2.77 kB
TypeScript
import type { Route, RouteInfo, Location, Player, StrictPoint2D } from '../../types/index.js';
import Emitter from '../../helpers/EventEmitter.js';
import type Dynmap from './Dynmap.js';
type GPSEvents = {
error: {
err: string;
msg: string;
};
underground: string | {
lastLocation: StrictPoint2D;
routeInfo: RouteInfo;
};
locationUpdate: RouteInfo;
};
declare class GPS extends Emitter<GPSEvents> {
#private;
get map(): Dynmap;
get emittedUnderground(): boolean;
protected set emittedUnderground(val: boolean);
get lastLoc(): {
x: number;
z: number;
};
protected set lastLoc(val: {
x: number;
z: number;
});
static readonly Routes: {
readonly SAFEST: {
readonly avoidPvp: boolean;
readonly avoidPrivate: boolean;
};
readonly FASTEST: {
readonly avoidPvp: boolean;
readonly avoidPrivate: boolean;
};
readonly AVOID_PRIVATE: {
readonly avoidPvp: boolean;
readonly avoidPrivate: boolean;
};
readonly AVOID_PVP: {
readonly avoidPvp: boolean;
readonly avoidPrivate: boolean;
};
};
constructor(map: Dynmap);
playerIsOnline: (player: Player) => boolean;
readonly track: (playerName: string, interval?: number, route?: {
readonly avoidPvp: boolean;
readonly avoidPrivate: boolean;
}) => Promise<this>;
readonly safestRoute: (loc: Location) => Promise<{
nation: import("../../types/gps.js").RouteInfoNation | {
name: string;
capital: {
x: number | string;
z: number | string;
name: string;
};
};
distance: number;
direction: string;
}>;
readonly fastestRoute: (loc: Location) => Promise<{
nation: import("../../types/gps.js").RouteInfoNation | {
name: string;
capital: {
x: number | string;
z: number | string;
name: string;
};
};
distance: number;
direction: string;
}>;
readonly findRoute: (loc: Location, options: Route) => Promise<{
nation: import("../../types/gps.js").RouteInfoNation | {
name: string;
capital: {
x: number | string;
z: number | string;
name: string;
};
};
distance: number;
direction: string;
}>;
static cardinalDirection(origin: Location, destination: Location): "east" | "north" | "west" | "south";
}
export { GPS, GPS as default };
//# sourceMappingURL=GPS.d.ts.map