Library referenceClasses
MapApi
GET /api/map/* and /api/maps/*: map details, featured maps and map leaderboards
Constructors
Constructor
new MapApi(client): MapApi;Parameters
| Parameter | Type |
|---|---|
client | KrunkerClient |
Returns
MapApi
Methods
featured()
featured(): Promise<FeaturedMaps>;GET /api/maps/featured, newest first
Returns
Promise<FeaturedMaps>
get()
get(mapName): Promise<MapInfo>;GET /api/map/:mapname, case-insensitive, 404 for restricted or deleted maps
Parameters
| Parameter | Type |
|---|---|
mapName | string |
Returns
Promise<MapInfo>
leaderboard()
leaderboard(mapName, query?): Promise<MapLeaderboard>;GET /api/map/:mapname/leaderboard, 25 per page, empty entries when the map has no board
Parameters
| Parameter | Type |
|---|---|
mapName | string |
query? | Page & MapLeaderboardQuery |
Returns
Promise<MapLeaderboard>
leaderboardPlayer()
leaderboardPlayer(
mapName,
playerName,
query?
): Promise<MapLeaderboardPlayer>;GET /api/map/:mapname/leaderboard/player/:playername, 404 when the player has no entry
Parameters
| Parameter | Type |
|---|---|
mapName | string |
playerName | string |
query? | MapLeaderboardQuery |
Returns
Promise<MapLeaderboardPlayer>