UNPKG

ddnet

Version:

A typescript npm package for interacting with data from ddnet.org

112 lines (111 loc) 2.63 kB
import { LatestFinishesFilters, ServerRegion, Tile } from '../../util.js'; import { Map } from '../maps/Map.js'; import { Mapper } from '../maps/Mapper.js'; import { ServerType } from '../players/Servers.js'; import { Finish } from './Finish.js'; /** * Represents a map release. */ export declare class Release { /** * The name of this map. */ name: string; /** * The type of this map. */ type: ServerType; /** * The url of this map on ddnet.org */ url: string; /** * The direct url of this map's thumbnail image. */ thumbnailUrl: string; /** * The url to the interactive web preview of this map. */ webPreviewUrl: string; /** * Amount of points awarded for completing this map. */ points: number; /** * Star difficulty of this map. */ difficulty: number; /** * Authors of this map. */ mappers: Mapper[]; /** * Release timestamp of this map. */ releasedTimestamp: number | null; /** * The width of this map. */ width: number; /** * The height of this map. */ height: number; /** * Array of tiles used in this map. */ tiles: Tile[]; /** * Construct a new {@link Release} instance. */ constructor(data: { type: string; name: string; website: string; thumbnail: string; web_preview: string; points: number; difficulty: number; mapper: string; releaseTimestamp: number; width: number; height: number; tiles: string[]; }); /** * Returns a new {@link Map} object from the {@link name} of this release. */ toMap( /** * The region to pull ranks from in the `toMap` function from the returned value. Omit for global ranks. */ rankSource?: ServerRegion | null, /** * Wether to bypass the cache. */ force?: boolean): Promise<Map>; /** * Returns the name and url of this release in markdown format. */ toString(): string; /** * Get latest finishes, filtered for this release. */ getLatestFinishes( /** * Filtering options for latest finishes. */ filters?: LatestFinishesFilters): Promise<Finish[]>; /** * Get latest finishes, filtered for a specific release. */ static getLatestFinishes( /** * The name of the map. */ mapName: string, /** * Filtering options for latest finishes. */ filters?: LatestFinishesFilters): Promise<Finish[]>; }