The autogeneratedEndpointStructs.ts file that is auto-generated from a closed-source script (I can't open a PR to fix it), contains the following types:
data: {
stats: {
all: {
....
trio: {
score: number;
scorePerMin: number;
scorePerMatch: number;
wins: number;
top3: number;
top6: number;
kills: number;
killsPerMin: number;
killsPerMatch: number;
deaths: number;
kd: number;
matches: number;
winRate: number;
minutesPlayed: number;
playersOutlived: number;
lastModified: string;
},
},
keyboardMouse: {
....
trio: {
score: number;
scorePerMin: number;
scorePerMatch: number;
wins: number;
top3: number;
top6: number;
kills: number;
killsPerMin: number;
killsPerMatch: number;
deaths: number;
kd: number;
matches: number;
winRate: number;
minutesPlayed: number;
playersOutlived: number;
lastModified: string;
},
},
gamepad: {
....
trio: {
score: number;
scorePerMin: number;
scorePerMatch: number;
wins: number;
top3: number;
top6: number;
kills: number;
killsPerMin: number;
killsPerMatch: number;
deaths: number;
kd: number;
matches: number;
winRate: number;
minutesPlayed: number;
playersOutlived: number;
lastModified: string;
},
},
touch: {
....
trio: {
score: number;
scorePerMin: number;
scorePerMatch: number;
wins: number;
top3: number;
top6: number;
kills: number;
killsPerMin: number;
killsPerMatch: number;
deaths: number;
kd: number;
matches: number;
winRate: number;
minutesPlayed: number;
playersOutlived: number;
lastModified: string;
},
},
}
}
As per the documentation, Trio is always null, so the type should be:
data: {
stats: {
all: {
....
trio: null,
},
keyboardMouse: {
....
trio: null,
},
gamepad: {
....
trio: null,
},
touch: {
....
trio: null
},
}
}
Most of the other stat types are also incorrect. For example the following should be optional (null | { ... }):
keyboardMouse, gamepad and touch (there will always be at least one of them available, but they are still nullable since we don't know which one)
solo, duo, and squad (same as above, we don't know which ones will be there)
data.image
I think for the stats, only stats.all.overall is not optional.
cc @ThisNils
The
autogeneratedEndpointStructs.tsfile that is auto-generated from a closed-source script (I can't open a PR to fix it), contains the following types:As per the documentation, Trio is always
null, so the type should be:Most of the other stat types are also incorrect. For example the following should be optional (
null | { ... }):keyboardMouse,gamepadandtouch(there will always be at least one of them available, but they are still nullable since we don't know which one)solo,duo, andsquad(same as above, we don't know which ones will be there)data.imageI think for the stats, only
stats.all.overallis not optional.cc @ThisNils