earthmc
Version:
An unofficial EarthMC library providing handy methods and extensive info.
16 lines • 1.04 kB
TypeScript
import endpoints from '../endpoints.json';
import { type Dispatcher } from "undici";
import type { AnyMap, RequestBodyV3 } from "../types/index.js";
export type EndpointVersion = 'v3';
export type ReqOptions = {
dispatcher?: Dispatcher;
} & Omit<Dispatcher.RequestOptions, 'origin' | 'path' | 'method'> & Partial<Pick<Dispatcher.RequestOptions, 'method'>>;
export declare const getEndpointUrl: (dataType: keyof typeof endpoints, map: string) => string;
export declare const asJSON: (url: string, options?: ReqOptions, retries?: number) => Promise<any>;
export declare const useArchive: (ts: number) => number;
export declare const getArchive: (url: string, unixTs?: number) => Promise<any>;
export declare const configData: <T>(mapName: AnyMap) => Promise<T>;
export declare const playerData: <T>(mapName: AnyMap) => Promise<T>;
export declare const mapData: <T>(mapName: AnyMap) => Promise<T>;
export declare const oapiDataV3: <TQuery>(endpoint?: string, body?: RequestBodyV3<TQuery>) => Promise<any>;
//# sourceMappingURL=endpoint.d.ts.map