ddnet
Version:
A typescript npm package for interacting with data from ddnet.org
90 lines (89 loc) • 2.1 kB
TypeScript
import { _Info_Servers } from '../../schemas/other/info.js';
/**
* Represents a community server location
*/
export declare class CommunityServerLocation {
/**
* The region of this location.
*/
region: string;
/**
* The flag id of this location.
*/
flagId: number;
/**
* Reported server types and addresses for this location.
*/
types: {
name: string;
addresses: string[];
}[];
/**
* Construct a new {@link CommunityServerLocation} instance.
*/
constructor(data: {
name: string;
flagId: number;
servers: Record<string, string[]>;
});
}
/**
* Represents a community.
*/
export declare class Community {
/**
* The id of this community.
*/
id: string;
/**
* The name of this community.
*/
name: string;
/**
* Wether to show finishes for maps.
*
* @remarks
* According to https://discord.com/channels/252358080522747904/293493549758939136/1274386594270543954
* This values decides wether fnished maps have a flag next to them in the server browser on the ddnet client.
*/
hasFinishes: boolean;
/**
* The icon for this community.
*/
icon: {
/**
* SHA256 hash of the icon file.
*/
sha256: string;
/**
* The community icon download url.
*/
url: string;
};
/**
* Server locations for this community along with their reported servers.
*/
serverLocations: CommunityServerLocation[];
/**
* Construct a new {@link Community} instance.
*/
constructor(data: {
id: string;
name: string;
has_finishes: boolean;
icon: {
sha256: string;
url: string;
servers: _Info_Servers[];
};
contact_urls: string[];
});
/**
* Returns a list of all server addresses of this community.
*/
getAllServerAddresses(): string[];
/**
* Returns the name of the community.
*/
toString(): string;
}