Skip to content

Commit

Permalink
refactor: explain GameInfo interface
Browse files Browse the repository at this point in the history
  • Loading branch information
KraXen72 committed Feb 12, 2023
1 parent cc6e35a commit 45f3462
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/global.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

type UserPrefs = {
[preference: string]: boolean | string;
};
Expand Down Expand Up @@ -109,6 +108,11 @@ interface CategoryName {
// discord rpc
type RPCargs = { details: string, state: string };

/**
* return type of window.getGameActivity()
* we can't ensure krunker doesen't change or fail to return this exact object
* this should be consumed as `Partial<GameInfo>` with fallbacks from elements for properties you are using
*/
interface GameInfo {

/** example: FRA:h83cx */
Expand All @@ -135,7 +139,7 @@ interface GameInfo {
mode: string,

/** example: false */
custom: false,
custom: boolean,

/** added by us, example: Baller */
skin?: string
Expand Down

0 comments on commit 45f3462

Please sign in to comment.