Skip to content

Commit

Permalink
chore(types): finish demo types
Browse files Browse the repository at this point in the history
  • Loading branch information
c43721 committed Nov 8, 2024
1 parent a6d5c47 commit 1c590a7
Show file tree
Hide file tree
Showing 2 changed files with 224 additions and 0 deletions.
159 changes: 159 additions & 0 deletions javascript-sdk/demostf/types/demo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,163 @@ export type Demo = {
* The unique id of the user who uploaded the demo
*/
uploader: number;

/**
* Gets the hash of the file
*/
hash: string;

/**
* Gets the backend the file is stored on
*/
backend: string;

/**
* Gets the path of the file
*/
path: string;
};

export type DemoInfo = {
/**
* The id of the demo
*/
id: number;

/**
* The URL of the demo
*/
url: string;

/**
* The name of the file
*/
name: string;

/**
* The hostname of the server that uploaded the demo
*/
server: string;

/**
* The duration in ticks of the demo
*/
duration: 1809;

/**
* The nickname of Source TV
*/
nick: string;

/**
* The map that was played
*/
map: string;

/**
* The date the demo was uploaded
*/
time: number;

/**
* The name of the RED team
*/
red: string;

/**
* The name of the BLU team
*/
blue: string;

/**
* The score of the RED team
*/
redScore: number;

/**
* The name of the BLU team
*/
blueScore: number;

/**
* The number of players in the demo
*/
playerCount: number;

/**
* The information about the uploader
*/
uploader: {
/**
* The id of the uploader
*/
id: number;

/**
* The steam id of the uploader
*/
steamid: string;

/**
* The name of the uploader
*/
name: string;
};

/**
* The information about each player in the demo
*/
players: [
{
/**
* The id of the player
*/
id: number;

/**
* The user id of the player
*/
user_id: number;

/**
* The name of the player
*/
name: string;

/**
* The team of the player
*/
team: string;

/**
* The class the player played on
*/
class: string;

/**
* The steam id of the user
*/
steamid: string;

/**
* The avatar URL of the player
*/
avatar: string;

/**
* The number of kills the player had
*/
kills: number;

/**
* The number of assists
*/
assists: number;

/**
* The number of times the player died
*/
deaths: number;
}
];
};
65 changes: 65 additions & 0 deletions javascript-sdk/demostf/types/requests.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
export type UploadRequest = {
/**
* The API key to use
*/
key: string;

/**
* The name of the demo file
*/
name: string;

/**
* The name of RED team
*/
red: string;

/**
* The name of BLU team
*/
blu: string;

/**
* The demo file to be uploaded
*/
demo: Blob;
};

/**
* The request object for searching demos
*/
export type DemoSearchRequest = {
/**
* The name of the map
*/
map: string;

/**
* The type of gamemode
*/
type: "4v4" | "6v6" | "hl";

/**
* The list of players that have played in the demo
*/
players: string[];
/**
* The max date the demo was uploaded on
*/
before: string;
/**
* The min date the demo was uploaded on
*/
after: string;

/**
* The min demo id
*/
before_id: string;
/**
* The max demo id
*/
after_id: string;
};

export type SortType = "ASC" | "DESC";

0 comments on commit 1c590a7

Please sign in to comment.