UNPKG

ddnet

Version:

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

72 lines (71 loc) 1.69 kB
import { Type } from '../../util.js'; import { Release } from '../other/Release.js'; import { Player } from '../players/Player.js'; /** * Represents a map author/mapper. */ export declare class Mapper { /** * Mapper query responses cache. (2h default TTL) */ private static cache; /** * Sets the TTL (Time-To-Live) for objects in cache. */ static setTTL: (ttlMS?: number) => void; /** * Clears the {@link Player.cache}. */ static clearCache: () => Promise<void>; /** * The name of this author. */ name: string; /** * The ddnet.org url to this author's map showcase page. */ mapShowcaseUrl: string; /** * The ddnet.org url to this author's player page. */ playerUrl: string; /** * Construct a new {@link Mapper} instance. */ constructor(data: { name: string; }); /** * Returns an array of releases by this author. */ getMaps( /** * If provided, the method will only return releases of this type. */ type?: Type): Promise<Release[]>; /** * Returns a new {@link Player} object from this author. */ toPlayer(): Promise<Player>; /** * Returns the name and mapShowcaseUrl of this Author in markdown format. */ toString(): string; /** * Search for a mapper. */ static search( /** * The value to search for. */ value: string, /** * Wether to bypass the cache. */ force?: boolean): Promise<{ name: string; mapCount: number; toPlayer: () => Promise<Player>; toMapper: () => Mapper; }[] | null>; }