mineplex
Version:
Wrapper for the Mineplex API
34 lines (33 loc) • 1.67 kB
TypeScript
import * as Promise from "bluebird";
import * as player from "./player";
import * as network from "./network";
import * as amplifier from "./amplifier";
export declare type Callback<T> = (err, res: T) => void;
export declare class APIError implements Error {
name: string;
statusCode: number;
error: string;
message: string;
constructor(base: any);
}
export interface Dictionary<T> {
[id: string]: T;
}
export declare class MineplexAPI {
private baseUrl;
private apiKey;
constructor(apiKey: string, baseUrl?: string);
getPlayer(player: string, callback?: Callback<player.Player>): Promise<player.Player>;
getPlayerStatus(player: string, callback?: Callback<player.Status>): Promise<player.Status>;
getPlayerFriends(player: string, callback?: Callback<Array<player.PlayerBase>>): Promise<player.PlayerBase[]>;
getNetworkStatus(callback?: Callback<network.NetworkStatus>): Promise<network.NetworkStatus>;
getRegionStatus(region: network.Region, callback?: Callback<network.RegionStatus>): Promise<network.RegionStatus>;
getServerStatus(region: network.Region, server: string, callback?: Callback<network.MinecraftServer>): Promise<network.MinecraftServer>;
getAmplifierGroups(callback?: Callback<Array<string>>): Promise<String[]>;
getAmplifiers(group: string, callback?: Callback<Array<amplifier.Amplifier>>): Promise<amplifier.Amplifier[]>;
getAllAmplifiers(callback?: Callback<Dictionary<Array<amplifier.Amplifier>>>): Promise<Dictionary<amplifier.Amplifier[]>>;
private apiCall<T>(resource, callback?);
private buildUrl(resource);
}
export * from "./player";
export * from "./network";