-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
467 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
export type GeneralStatsType = { | ||
/** The amount of users on the server, including anonymous accounts. */ | ||
usercount: number; | ||
/** The amount of users created a second (through the last minute). */ | ||
usercount_delta: number; | ||
/** The amount of anonymous accounts on the server. */ | ||
anoncount: number; | ||
/** The total amount of accounts ever created (including pruned anons etc.). */ | ||
totalaccounts: number; | ||
/** The amount of ranked (visible in TETRA LEAGUE leaderboard) accounts on the server. */ | ||
rankedcount: number; | ||
|
||
/** The amount of replays stored on the server. */ | ||
replaycount: number; | ||
|
||
/** The amount of games played across all users, including both off- and online modes. */ | ||
gamesplayed: number; | ||
/** The amount of games played a second (through the last minute). */ | ||
gamesplayed_delta: number; | ||
|
||
/** The amount of games played across all users, including both off- and online modes, excluding games that were not completed (e.g. retries) */ | ||
gamesfinished: number; | ||
/** The amount of seconds spent playing across all users, including both off- and online modes. */ | ||
gametime: number; | ||
|
||
/** The amount of keys pressed across all users, including both off- and online modes. */ | ||
inputs: number; | ||
/** The amount of pieces placed across all users, including both off- and online modes. */ | ||
piecesplaced: number; | ||
}; | ||
|
||
export type GeneralActivityType = { | ||
/** An array of plot points, newest points first. */ | ||
activity: number[]; | ||
}; | ||
|
||
export type RoleType = "anon" | "user" | "bot" | "halfmod" | "mod" | "admin" | "sysop" | "banned"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export type APIResponse = any; | ||
|
||
export * from "./General"; | ||
export * from "./League"; | ||
export * from "./User"; | ||
export * from "./Leaderboard"; | ||
export * from "./Record"; | ||
export * from "./News"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { LeagueInfosType, RoleType } from "."; | ||
|
||
export type Base_Leaderboard_UserInfoType = { | ||
/** The user's internal ID. */ | ||
_id: string; | ||
/** The user's username. */ | ||
username: string; | ||
/** The user's role */ | ||
role: RoleType; | ||
/** The user's XP in points. */ | ||
xp: number; | ||
/** The user's ISO 3166-1 country code, or null if hidden/unknown. Some vanity flags exist. */ | ||
country?: string; | ||
/** Whether this user is currently supporting TETR.IO <3 */ | ||
supporter: boolean; | ||
/** Whether this user is a verified account. */ | ||
verified: boolean; | ||
}; | ||
|
||
export type TL_Leaderboard_UserInfoType = Base_Leaderboard_UserInfoType & { | ||
/** This user's current TETRA LEAGUE standing: */ | ||
league: LeagueInfosType; | ||
}; | ||
|
||
export type XP_Leaderboard_UserInfoType = Base_Leaderboard_UserInfoType & { | ||
/** When the user account was created. If not set, this account was created before join dates were recorded. */ | ||
ts?: string; | ||
/** The amount of online games played by this user. If the user has chosen to hide this statistic, it will be -1. */ | ||
gamesplayed: number; | ||
/** The amount of online games won by this user. If the user has chosen to hide this statistic, it will be -1. */ | ||
gameswon: number; | ||
/** The amount of seconds this user spent playing, both on- and offline. If the user has chosen to hide this statistic, it will be -1. */ | ||
gametime: number; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
export type MiddleRanks = | ||
| "D+" | ||
| "C-" | ||
| "C" | ||
| "C+" | ||
| "B-" | ||
| "B" | ||
| "B+" | ||
| "A-" | ||
| "A" | ||
| "A+" | ||
| "S-" | ||
| "S" | ||
| "S+" | ||
| "SS" | ||
| "U"; | ||
export type AllRanks = MiddleRanks | "D" | "X" | "Z"; | ||
|
||
export type LeagueInfosType = { | ||
/** The amount of TETRA LEAGUE games played by this user. */ | ||
gamesplayed: number; | ||
/** The amount of TETRA LEAGUE games won by this user. */ | ||
gameswon: number; | ||
|
||
/** This user's TR (Tetra Rating), or -1 if less than 10 games were played. */ | ||
rating: number; | ||
/** This user's letter rank. Z is unranked. */ | ||
rank: AllRanks; | ||
/** This user's highest achieved rank this season. */ | ||
bestrank: MiddleRanks | "D" | "X"; | ||
|
||
/** This user's Glicko-2 rating. */ | ||
glicko?: number; | ||
/** This user's Glicko-2 Rating Deviation. If over 100, this user is unranked. */ | ||
rd?: number; | ||
|
||
/** This user's average APM (attack per minute) over the last 10 games. */ | ||
apm?: number; | ||
/** This user's average PPS (pieces per second) over the last 10 games. */ | ||
pps?: number; | ||
/** This user's average VS (versus score) over the last 10 games. */ | ||
vs?: number; | ||
/** Whether this user's RD is rising (has not played in the last week). */ | ||
decaying: boolean; | ||
}; | ||
|
||
export type LeagueInfosFullType = LeagueInfosType & { | ||
/** This user's position in global leaderboards, or -1 if not applicable. */ | ||
standing: number; | ||
/** This user's position in local leaderboards, or -1 if not applicable. */ | ||
standing_local: number; | ||
|
||
/** The next rank this user can achieve, if they win more games, or null if unranked (or the best rank). */ | ||
next_rank?: MiddleRanks | null; | ||
/** The previous rank this user can achieve, if they lose more games, or null if unranked (or the worst rank). */ | ||
prev_rank?: MiddleRanks | null; | ||
|
||
/** The position of the best player in the user's current rank, surpass them to go up a rank. -1 if unranked (or the best rank). */ | ||
next_at: number; | ||
/** The position of the worst player in the user's current rank, dip below them to go down a rank. -1 if unranked (or the worst rank). */ | ||
prev_at: number; | ||
|
||
/** This user's percentile position (0 is best, 1 is worst). */ | ||
percentile: number; | ||
|
||
/** This user's percentile rank, or Z if not applicable. */ | ||
percentile_rank: AllRanks; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { NewsRecordsType, streamID } from "."; | ||
|
||
export type NewsType = { | ||
/** The item's internal ID. */ | ||
_id: string; | ||
/** The item's stream. */ | ||
stream: streamID; | ||
/** The item's type. */ | ||
type: string; | ||
/** The item's records. */ | ||
data: NewsRecordsType; | ||
/** The item's creation date. */ | ||
ts: string; | ||
}; |
Oops, something went wrong.