-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.d.ts
418 lines (366 loc) · 9.4 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
declare module 'csgo-gsi-types' {
export import Provider = __GSICSGO.Provider
export import Map = __GSICSGO.Map
export import Auth = __GSICSGO.Auth
export import Player = __GSICSGO.Player
export import PlayerState = __GSICSGO.PlayerState
export import PlayerStats = __GSICSGO.PlayerStats
export import Grenades = __GSICSGO.Grenades
export import Grenade = __GSICSGO.Grenade
export import AllPlayers = __GSICSGO.AllPlayers
export import PlayerList = __GSICSGO.PlayerList
export import PhaseCountDown = __GSICSGO.Phase
export import Bomb = __GSICSGO.Bomb
export import Round = __GSICSGO.Round
export import Weapons = __GSICSGO.Weapons
export import Weapon = __GSICSGO.Weapon
export import weaponTypes = __GSICSGO.weaponTypes
export import grenadeTypes = __GSICSGO.grenadeTypes
export import WeaponSlotType = __GSICSGO.WeaponSlotType
export import TeamType = __GSICSGO.TeamType
export import RoundWinningType = __GSICSGO.RoundWinningType
export import BombState = __GSICSGO.BombState
export import PhaseExt = __GSICSGO.PhaseExt
export import PhaseMap = __GSICSGO.PhaseMap
export import GameStateSpectating = __GSICSGO.GameStateSpectating
export import GameStatePlaying = __GSICSGO.GameStatePlaying
export import GameStateMenu = __GSICSGO.GameStateMenu
export import GameState = __GSICSGO.GameState
}
declare namespace __GSICSGO {
export interface GameState {
provider: Provider
auth: Auth
player?: Player
allplayers?: AllPlayers
round?: Round
phase_countdowns?: Phase
grenades?: Grenades
previously?: Previously
added?: AddedPlaying
bomb?: Bomb
map?: Map
}
export interface GameStateSpectating {
provider: Provider
map: Map
round?: Round
player: Player
allplayers: AllPlayers
phase_countdowns: Phase
grenades: Grenades
previously: Previously
bomb: Bomb
auth: Auth
}
export interface GameStateMenu {
provider: Provider
player: PlayerMenu
auth: Auth
}
export interface GameStatePlaying {
provider: Provider
map: Map
round: Round
player: PlayerPlaying
previously?: PreviouslyPlaying
added?: AddedPlaying
auth: Auth
}
export interface AddedPlaying {
round?: {
bomb?: boolean
win_team?: boolean
}
map?: Map
}
export interface Round {
phase: PhaseRound
bomb?: 'planted' | 'defused' | 'exploded'
win_team?: TeamType
}
export interface Previously {
provider?: Provider
map?: Map
round?: Round
player?: Player
allplayers?: AllPlayers
phase_countdowns?: Phase
grenades?: Grenades
bomb?: BombState
}
export interface PreviouslyPlaying {
provider?: Provider
map?: Map
round?: Round
player?: PlayerPlaying
auth?: Auth
}
export interface Provider {
name: string
appid: number
version: number
steamid: string
timestamp: number
}
export interface Auth {
token: string
}
export interface Player {
clan?: string
steamid: string
name: string
observer_slot: ObservatorSlotType
team: TeamType
activity: PlayerActivityType
state: PlayerState
position: string
forward: string
spectarget?: string
}
export interface PlayerPlaying {
clan?: string
steamid: string
name: string
observer_slot: ObservatorSlotType
team: TeamType
activity: PlayerActivityType
state: PlayerState
}
export interface PlayerMenu {
steamid: string
name: string
activity: 'menu'
}
export interface Grenades {
[key: string]: Grenade
}
export interface AllPlayers {
[steamid: string]: PlayerList
}
export interface PlayerList {
clan?: string
name: string
observer_slot: ObservatorSlotType
team: TeamType
state: PlayerState
match_stats: PlayerStats
weapons: Weapons
position: string
forward: string
}
export type Weapons = {
[key in WeaponSlotType]?: Weapon
}
export type Weapon = weaponTypes.Knife |
weaponTypes.Pistol |
weaponTypes.Bomb |
weaponTypes.Grenade |
weaponTypes.MachineGun |
weaponTypes.Rifle |
weaponTypes.Shotgun |
weaponTypes.SniperRifle |
weaponTypes.SubmachineGun
namespace weaponTypes {
type WeaponState = 'holstered' | 'active'
interface Knife {
type: 'Knife'
name: 'weapon_knife_t' | 'weapon_knife'
paintkit: string
state: WeaponState
}
interface Bomb {
type: 'C4'
name: 'weapon_c4'
paintkit: string
state: WeaponState
}
interface Pistol {
type: 'Pistol'
name: 'weapon_deagle' |
'weapon_elite' |
'weapon_fiveseven' |
'weapon_glock' |
'weapon_cz75a' |
'weapon_hkp2000' |
'weapon_p250' |
'weapon_revolver' |
'weapon_tec9' |
'weapon_usp_silencer'
paintkit: string
ammo_clip: number
ammo_clip_max: number
ammo_reserve: number
state: WeaponState
}
export interface Shotgun {
type: 'Shotgun'
name: 'weapon_xm1014' | 'weapon_nova' | 'weapon_mag7' | 'weapon_sawedoff'
paintkit: string
ammo_clip: number
ammo_clip_max: number
ammo_reserve: number
state: WeaponState
}
export interface MachineGun {
type: 'Machine Gun'
name: 'weapon_m249' | 'weapon_negev'
paintkit: string
ammo_clip: number
ammo_clip_max: number
ammo_reserve: number
state: WeaponState
}
export interface SubmachineGun {
type: 'Submachine Gun'
name: 'weapon_mac10' |
'weapon_bizon' |
'weapon_mp5sd' |
'weapon_mp7' |
'weapon_mp9' |
'weapon_p90' |
'weapon_ump45'
paintkit: string
ammo_clip: number
ammo_clip_max: number
ammo_reserve: number
state: WeaponState
}
interface Rifle {
type: 'Rifle'
name: 'weapon_ak47' |
'weapon_aug' |
'weapon_famas' |
'weapon_galilar' |
'weapon_m4a1' |
'weapon_m4a1_silencer' |
'weapon_sg556'
paintkit: string
ammo_clip: number
ammo_clip_max: number
ammo_reserve: number
state: WeaponState
}
interface SniperRifle {
type: 'SniperRifle'
name: 'weapon_awp' | 'weapon_g3sg1' | 'weapon_scar20' | 'weapon_ssg08'
paintkit: string
ammo_clip: number
ammo_clip_max: number
ammo_reserve: number
state: WeaponState
}
interface Grenade {
type: 'Grenade'
name: 'weapon_smokegrenade' |
'weapon_decoy' |
'weapon_hegrenade' |
'weapon_incgrenade' |
'weapon_molotov'
paintkit: string
ammo_reserve: number
state: WeaponState
}
}
export type Grenade = grenadeTypes.DecoySmokeGrenade |
grenadeTypes.DefaultGrenade |
grenadeTypes.FireBombGrenade
namespace grenadeTypes {
interface DecoySmokeGrenade {
owner: number
type: 'decoy' | 'smoke'
position: string
velocity: string,
lifetime: string,
effecttime: string
}
interface DefaultGrenade {
owner: number
type: 'frag' | 'firebomb' | 'flashbang'
position: string
velocity: string,
lifetime: string
}
interface FireBombGrenade {
owner: number
type: 'inferno'
lifetime: string
flames: { [key: string]: string }
}
}
export interface PlayerStats {
kills: number
assists: number
deaths: number
mvps: number
score: number
}
export interface Map {
mode: string
name: string
phase: PhaseMap
round: number
team_ct: Team
team_t: Team
num_matches_to_win_series: number
current_spectators: number
souvenirs_total: number
round_wins?: { [key: string]: RoundWinningType }
}
export interface Team {
name?: string
score: number
consecutive_round_losses: number
timeouts_remaining: number
matches_won_this_series: number
}
export interface Phase {
phase: PhaseExt
// ! Beaware that 'phase_ends_in' actually returns float in string format.
phase_ends_in: number
}
export interface Bomb {
state: BombState
position: string
player?: string
countdown?: string
}
export interface PlayerState {
health: number
armor: number
helmet: boolean
flashed: number
smoked: number
burning: number
money: number
round_kills: number
round_killhs: number
round_totaldmg: number
equip_value: number
defusekit?: boolean
}
export type WeaponSlotType = 'weapon_0' |
'weapon_1' |
'weapon_2' |
'weapon_3' |
'weapon_4' |
'weapon_5' |
'weapon_6' |
'weapon_7' |
'weapon_8' |
'weapon_9'
export type RoundWinningType = 'ct_win_time' |
'ct_win_elimination' |
't_win_elimination' |
't_win_bomb' |
'ct_win_defuse'
export type GrenadeType = 'inferno' | 'smoke' | 'flashbang' | 'frag' | 'decoy'
export type PlayerActivityType = 'playing' | 'free' | 'textinput' | 'menu'
export type GameModeType = 'casual' | 'competitive'
export type ObservatorSlotType = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
export type TeamType = 'CT' | 'T'
export type BombState = 'planted' | 'planting' | 'exploded' | 'defusing' | 'defused' | 'carried' | 'dropped'
export type PhaseRound = 'live' | 'freezetime' | 'over'
export type PhaseMap = 'live' | 'intermission' | 'gameover' | 'warmup'
export type PhaseExt = 'freezetime' | 'bomb' | 'warmup' | 'live' | 'over' | 'defuse' | 'paused' | 'timeout_ct' | 'timeout_t'
}