UNPKG

ddnet

Version:

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

62 lines (61 loc) 1.51 kB
import { Type } from '../../util.js'; import { Release } from './Release.js'; /** * Represents DDNet map releases. */ export declare class Releases { #private; /** * Releases responses cache. (12h default TTL) */ private static cache; /** * Sets the TTL (Time-To-Live) for objects in cache. */ static setTTL: (ttlMS?: number) => void; /** * Clears the {@link Releases.cache}. */ static clearCache: () => Promise<void>; /** * Array with all the map releases. */ maps: Release[]; /** * Create a new instance of {@link Releases} from API data. * Not intended to be used, use {@link new Releases.new} instead. */ private constructor(); /** * Fetch, parse and construct a new {@link Releases} instance. */ static new( /** * Wether to bypass the releases data cache. */ bypassCache?: boolean): Promise<Releases>; /** * Parse an object using the {@link _Schema_releases releases raw data zod schema}. */ private static parseObject; /** * Fetch the releases data from the API. */ private static makeRequest; /** * Populate the object with the raw releases data. */ private populate; /** * Refresh the releases data. */ refresh(): Promise<this>; /** * Get all the releases of a specific {@link Type}. */ getServer( /** * The type of the releases. */ type: Type): Release[]; }