Library referenceClasses
PublicGameApi
the static game data the page loads at start plus the community map and mod records
Constructors
Constructor
new PublicGameApi(gapi): PublicGameApi;Parameters
| Parameter | Type |
|---|---|
gapi | KrunkerClient |
Returns
PublicGameApi
Methods
creatorEvents()
creatorEvents(): Promise<CreatorEvents>;GET /creators/events, upcoming events and the running surveys
Returns
Promise<CreatorEvents>
mapByName()
mapByName(mapName): Promise<CommunityMap>;GET /maps/by-name/:name, the community map record; "Burg" resolves to a community map of that name, not the official one
Parameters
| Parameter | Type |
|---|---|
mapName | string |
Returns
Promise<CommunityMap>
mapConfig()
mapConfig(mapId): Promise<MapConfig>;GET /maps/:id, the whole map file (120 KB for Burg)
Parameters
| Parameter | Type |
|---|---|
mapId | number |
Returns
Promise<MapConfig>
mapLeaderboard()
mapLeaderboard(mapName, query?): Promise<CommunityMapLeaderboard>;GET /maps/by-name/:name/leaderboard, 25 per page
Parameters
| Parameter | Type |
|---|---|
mapName | string |
query? | CommunityLeaderboardQuery |
Returns
Promise<CommunityMapLeaderboard>
maps()
maps(): Promise<OfficialMap[]>;GET /maps, the official map list, index = id = preview image number
Returns
Promise<OfficialMap[]>
modByName()
modByName(modName): Promise<ModInfo>;GET /mods/by-name/:name
Parameters
| Parameter | Type |
|---|---|
modName | string |
Returns
Promise<ModInfo>
titles()
titles(): Promise<Title[]>;GET /titles, every player title with its requirement
Returns
Promise<Title[]>