earthmc
Version:
An unofficial EarthMC library providing handy methods and extensive info.
54 lines • 1.72 kB
TypeScript
import type { Point2D, HexString, Opacity, Prettify, StrictPoint2D, Location } from '../types/index.js';
export interface SquaremapPlayersResponse {
max: number;
players: SquaremapRawPlayer[];
}
export type SquaremapRawPlayer = Prettify<Location & {
uuid: string;
name: string;
display_name: string;
yaw: string | number;
world: "minecraft_overworld" | "minecraft_nether" | "-some-other-bogus-world-" | "some-other-bogus-world";
}>;
export type SquaremapMapResponse = SquaremapMarkerset[];
export type SquaremapMarkerset = Prettify<{
id: "towny" | "chunky";
name: string;
markers: SquaremapArea[];
z_index: number;
order: number;
timestamp: number;
hide: boolean;
control: boolean;
}>;
export type SquaremapAreaType = "polygon" | "icon" | "rectangle" | "polyline" | "circle" | "ellipse";
export interface SquaremapPolygon {
points: Point2D[][][];
}
export interface SquaremapPolyline {
fill: boolean;
points: Point2D[];
}
export type SquaremapIcon = Prettify<{
icon: string;
point: Point2D;
size: Point2D;
anchor: Point2D;
tooltip_anchor: Point2D;
}>;
export type SquaremapMarker = Prettify<{
popup: string;
tooltip: string;
type: SquaremapAreaType;
color?: HexString;
opacity?: Opacity;
fillColor?: HexString;
fillOpacity?: Opacity;
}>;
type CommonFields = Prettify<Omit<Partial<SquaremapPolygon>, 'points'> & Omit<Partial<SquaremapPolyline>, 'points'> & Partial<SquaremapIcon>>;
type SquaremapPoints = {
points?: StrictPoint2D[][][] | StrictPoint2D[];
};
export type SquaremapArea = Prettify<SquaremapMarker & CommonFields & SquaremapPoints>;
export {};
//# sourceMappingURL=squaremap.d.ts.map