Skip to content

Commit cb66034

Browse files
committed
chore(types): finish demo types
1 parent 40ff31f commit cb66034

File tree

2 files changed

+224
-0
lines changed

2 files changed

+224
-0
lines changed

javascript-sdk/demostf/types/demo.ts

+159
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,163 @@ export type Demo = {
6868
* The unique id of the user who uploaded the demo
6969
*/
7070
uploader: number;
71+
72+
/**
73+
* Gets the hash of the file
74+
*/
75+
hash: string;
76+
77+
/**
78+
* Gets the backend the file is stored on
79+
*/
80+
backend: string;
81+
82+
/**
83+
* Gets the path of the file
84+
*/
85+
path: string;
86+
};
87+
88+
export type DemoInfo = {
89+
/**
90+
* The id of the demo
91+
*/
92+
id: number;
93+
94+
/**
95+
* The URL of the demo
96+
*/
97+
url: string;
98+
99+
/**
100+
* The name of the file
101+
*/
102+
name: string;
103+
104+
/**
105+
* The hostname of the server that uploaded the demo
106+
*/
107+
server: string;
108+
109+
/**
110+
* The duration in ticks of the demo
111+
*/
112+
duration: 1809;
113+
114+
/**
115+
* The nickname of Source TV
116+
*/
117+
nick: string;
118+
119+
/**
120+
* The map that was played
121+
*/
122+
map: string;
123+
124+
/**
125+
* The date the demo was uploaded
126+
*/
127+
time: number;
128+
129+
/**
130+
* The name of the RED team
131+
*/
132+
red: string;
133+
134+
/**
135+
* The name of the BLU team
136+
*/
137+
blue: string;
138+
139+
/**
140+
* The score of the RED team
141+
*/
142+
redScore: number;
143+
144+
/**
145+
* The name of the BLU team
146+
*/
147+
blueScore: number;
148+
149+
/**
150+
* The number of players in the demo
151+
*/
152+
playerCount: number;
153+
154+
/**
155+
* The information about the uploader
156+
*/
157+
uploader: {
158+
/**
159+
* The id of the uploader
160+
*/
161+
id: number;
162+
163+
/**
164+
* The steam id of the uploader
165+
*/
166+
steamid: string;
167+
168+
/**
169+
* The name of the uploader
170+
*/
171+
name: string;
172+
};
173+
174+
/**
175+
* The information about each player in the demo
176+
*/
177+
players: [
178+
{
179+
/**
180+
* The id of the player
181+
*/
182+
id: number;
183+
184+
/**
185+
* The user id of the player
186+
*/
187+
user_id: number;
188+
189+
/**
190+
* The name of the player
191+
*/
192+
name: string;
193+
194+
/**
195+
* The team of the player
196+
*/
197+
team: string;
198+
199+
/**
200+
* The class the player played on
201+
*/
202+
class: string;
203+
204+
/**
205+
* The steam id of the user
206+
*/
207+
steamid: string;
208+
209+
/**
210+
* The avatar URL of the player
211+
*/
212+
avatar: string;
213+
214+
/**
215+
* The number of kills the player had
216+
*/
217+
kills: number;
218+
219+
/**
220+
* The number of assists
221+
*/
222+
assists: number;
223+
224+
/**
225+
* The number of times the player died
226+
*/
227+
deaths: number;
228+
}
229+
];
71230
};
+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
export type UploadRequest = {
2+
/**
3+
* The API key to use
4+
*/
5+
key: string;
6+
7+
/**
8+
* The name of the demo file
9+
*/
10+
name: string;
11+
12+
/**
13+
* The name of RED team
14+
*/
15+
red: string;
16+
17+
/**
18+
* The name of BLU team
19+
*/
20+
blu: string;
21+
22+
/**
23+
* The demo file to be uploaded
24+
*/
25+
demo: Blob;
26+
};
27+
28+
/**
29+
* The request object for searching demos
30+
*/
31+
export type DemoSearchRequest = {
32+
/**
33+
* The name of the map
34+
*/
35+
map: string;
36+
37+
/**
38+
* The type of gamemode
39+
*/
40+
type: "4v4" | "6v6" | "hl";
41+
42+
/**
43+
* The list of players that have played in the demo
44+
*/
45+
players: string[];
46+
/**
47+
* The max date the demo was uploaded on
48+
*/
49+
before: string;
50+
/**
51+
* The min date the demo was uploaded on
52+
*/
53+
after: string;
54+
55+
/**
56+
* The min demo id
57+
*/
58+
before_id: string;
59+
/**
60+
* The max demo id
61+
*/
62+
after_id: string;
63+
};
64+
65+
export type SortType = "ASC" | "DESC";

0 commit comments

Comments
 (0)