earthmc
Version:
An unofficial EarthMC library providing handy methods and extensive info.
196 lines • 6.07 kB
TypeScript
import type Squaremap from "./Squaremap.js";
import type { SquaremapTown, StrictPoint2D } from "../../types/index.js";
import type { EntityApi } from "../../helpers/EntityApi.js";
import { NotFoundError } from "../../utils/errors.js";
declare class Towns implements EntityApi<SquaremapTown | NotFoundError> {
#private;
get map(): Squaremap;
constructor(map: Squaremap);
readonly fromNation: (nationName: string) => Promise<NotFoundError | {
name: string;
nation: string | "No Nation";
mayor: string;
residents: string[];
area: number;
x: number;
z: number;
bounds: import("../../types/town.js").TownBounds;
colours: {
fill: import("../../types/util.js").HexString;
outline: import("../../types/util.js").HexString;
};
opacities?: {
fill: import("../../types/util.js").Opacity;
outline: import("../../types/util.js").Opacity;
};
board?: string;
foundedTimestamp: number;
councillors: string[];
wikis?: {
town?: string;
nation?: string;
};
flags: {
pvp: boolean;
public: boolean;
capital: boolean;
};
points: StrictPoint2D[];
} | (NotFoundError | {
name: string;
nation: string | "No Nation";
mayor: string;
residents: string[];
area: number;
x: number;
z: number;
bounds: import("../../types/town.js").TownBounds;
colours: {
fill: import("../../types/util.js").HexString;
outline: import("../../types/util.js").HexString;
};
opacities?: {
fill: import("../../types/util.js").Opacity;
outline: import("../../types/util.js").Opacity;
};
board?: string;
foundedTimestamp: number;
councillors: string[];
wikis?: {
town?: string;
nation?: string;
};
flags: {
pvp: boolean;
public: boolean;
capital: boolean;
};
points: StrictPoint2D[];
})[]>;
readonly get: (...names: string[]) => Promise<NotFoundError | {
name: string;
nation: string | "No Nation";
mayor: string;
residents: string[];
area: number;
x: number;
z: number;
bounds: import("../../types/town.js").TownBounds;
colours: {
fill: import("../../types/util.js").HexString;
outline: import("../../types/util.js").HexString;
};
opacities?: {
fill: import("../../types/util.js").Opacity;
outline: import("../../types/util.js").Opacity;
};
board?: string;
foundedTimestamp: number;
councillors: string[];
wikis?: {
town?: string;
nation?: string;
};
flags: {
pvp: boolean;
public: boolean;
capital: boolean;
};
points: StrictPoint2D[];
} | (NotFoundError | {
name: string;
nation: string | "No Nation";
mayor: string;
residents: string[];
area: number;
x: number;
z: number;
bounds: import("../../types/town.js").TownBounds;
colours: {
fill: import("../../types/util.js").HexString;
outline: import("../../types/util.js").HexString;
};
opacities?: {
fill: import("../../types/util.js").Opacity;
outline: import("../../types/util.js").Opacity;
};
board?: string;
foundedTimestamp: number;
councillors: string[];
wikis?: {
town?: string;
nation?: string;
};
flags: {
pvp: boolean;
public: boolean;
capital: boolean;
};
points: StrictPoint2D[];
})[]>;
readonly all: (_removeAccents?: boolean) => Promise<SquaremapTown[]>;
readonly nearby: (location: StrictPoint2D, radius: StrictPoint2D, towns?: SquaremapTown[]) => Promise<{
name: string;
nation: string | "No Nation";
mayor: string;
residents: string[];
area: number;
x: number;
z: number;
bounds: import("../../types/town.js").TownBounds;
colours: {
fill: import("../../types/util.js").HexString;
outline: import("../../types/util.js").HexString;
};
opacities?: {
fill: import("../../types/util.js").Opacity;
outline: import("../../types/util.js").Opacity;
};
board?: string;
foundedTimestamp: number;
councillors: string[];
wikis?: {
town?: string;
nation?: string;
};
flags: {
pvp: boolean;
public: boolean;
capital: boolean;
};
points: StrictPoint2D[];
}[]>;
readonly invitable: (nationName: string, includeBelonging?: boolean) => Promise<{
name: string;
nation: string | "No Nation";
mayor: string;
residents: string[];
area: number;
x: number;
z: number;
bounds: import("../../types/town.js").TownBounds;
colours: {
fill: import("../../types/util.js").HexString;
outline: import("../../types/util.js").HexString;
};
opacities?: {
fill: import("../../types/util.js").Opacity;
outline: import("../../types/util.js").Opacity;
};
board?: string;
foundedTimestamp: number;
councillors: string[];
wikis?: {
town?: string;
nation?: string;
};
flags: {
pvp: boolean;
public: boolean;
capital: boolean;
};
points: StrictPoint2D[];
}[]>;
}
export { Towns, Towns as default };
//# sourceMappingURL=Towns.d.ts.map