@bluebottle_gg/league-broadcast-client 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1052 @@
1
+ /**
2
+ * This is an auto-generated file.
3
+ * Any changes made to this file can be lost when this file is regenerated.
4
+ */
5
+ declare enum GameState$1 {
6
+ OutOfGame = 0,
7
+ Loading = 1,
8
+ Running = 2,
9
+ Paused = 3,
10
+ Mocking = 4,
11
+ GameOver = 5,
12
+ ChampionSelect = 6
13
+ }
14
+
15
+ /**
16
+ * This is an auto-generated file.
17
+ * Any changes made to this file can be lost when this file is regenerated.
18
+ */
19
+ declare class championAbilityData {
20
+ spellName: string;
21
+ iconAsset: string;
22
+ iconName: string;
23
+ isPassive?: boolean;
24
+ }
25
+
26
+ /**
27
+ * This is an auto-generated file.
28
+ * Any changes made to this file can be lost when this file is regenerated.
29
+ */
30
+ declare enum SpellSlotIndex {
31
+ Q = 0,
32
+ W = 1,
33
+ E = 2,
34
+ R = 3,
35
+ D = 4,
36
+ F = 5,
37
+ Item1 = 6,
38
+ Item2 = 7,
39
+ Item3 = 8,
40
+ Item4 = 9,
41
+ Item5 = 10,
42
+ Item6 = 11,
43
+ ItemTrinket = 12,
44
+ Recall = 13,
45
+ Quest = 14,
46
+ Auto1 = 64,
47
+ Auto2 = 65,
48
+ Auto3 = 66
49
+ }
50
+
51
+ /**
52
+ * This is an auto-generated file.
53
+ * Any changes made to this file can be lost when this file is regenerated.
54
+ */
55
+
56
+ declare class ingameAbilityInfo {
57
+ identifier: string;
58
+ displayName: string;
59
+ slot: SpellSlotIndex;
60
+ totalCooldown: number;
61
+ cooldown: number;
62
+ level: number;
63
+ charges: number;
64
+ assets?: championAbilityData;
65
+ }
66
+
67
+ /**
68
+ * This is an auto-generated file.
69
+ * Any changes made to this file can be lost when this file is regenerated.
70
+ */
71
+ declare class itemWithAsset {
72
+ id: number;
73
+ slot: number;
74
+ displayName: string;
75
+ assetUrl: string;
76
+ modifierUrl?: string;
77
+ cost: number;
78
+ count: number;
79
+ combineCost: number;
80
+ stats?: number[];
81
+ cooldown?: number;
82
+ maxCooldown?: number;
83
+ stacks: number;
84
+ }
85
+
86
+ /**
87
+ * This is an auto-generated file.
88
+ * Any changes made to this file can be lost when this file is regenerated.
89
+ */
90
+ declare class simpleChampionData {
91
+ id: number;
92
+ alias: string;
93
+ name: string;
94
+ splashCenteredImg: string;
95
+ splashImg: string;
96
+ loadingImg: string;
97
+ squareImg: string;
98
+ tileImg: string;
99
+ }
100
+
101
+ /**
102
+ * This is an auto-generated file.
103
+ * Any changes made to this file can be lost when this file is regenerated.
104
+ */
105
+
106
+ declare class damageGraphEntry {
107
+ champion?: simpleChampionData;
108
+ abilities?: ingameAbilityInfo[];
109
+ activeItems?: itemWithAsset[];
110
+ name: string;
111
+ team?: number;
112
+ damageByType: {
113
+ [key: string]: number;
114
+ };
115
+ totalDamageDealt: number;
116
+ respawnTime?: number;
117
+ level?: number;
118
+ health: number;
119
+ maxHealth: number;
120
+ role: string;
121
+ }
122
+
123
+ /**
124
+ * This is an auto-generated file.
125
+ * Any changes made to this file can be lost when this file is regenerated.
126
+ */
127
+
128
+ declare class ingameDamageGraphData {
129
+ damageDealt: damageGraphEntry[];
130
+ }
131
+
132
+ /**
133
+ * This is an auto-generated file.
134
+ * Any changes made to this file can be lost when this file is regenerated.
135
+ */
136
+ declare class singleGameGoldGraphData {
137
+ goldAtTime: {
138
+ [key: number]: {
139
+ [key: number]: number;
140
+ };
141
+ };
142
+ winner?: number;
143
+ teams: {
144
+ [key: number]: string;
145
+ };
146
+ }
147
+
148
+ /**
149
+ * This is an auto-generated file.
150
+ * Any changes made to this file can be lost when this file is regenerated.
151
+ */
152
+
153
+ declare class ingameGoldGraphData {
154
+ current: singleGameGoldGraphData;
155
+ previousGames?: singleGameGoldGraphData[];
156
+ title?: string;
157
+ }
158
+
159
+ /**
160
+ * This is an auto-generated file.
161
+ * Any changes made to this file can be lost when this file is regenerated.
162
+ */
163
+ declare class cDragonPerkInfo {
164
+ id: number;
165
+ name: string;
166
+ iconPath: string;
167
+ }
168
+
169
+ /**
170
+ * This is an auto-generated file.
171
+ * Any changes made to this file can be lost when this file is regenerated.
172
+ */
173
+
174
+ declare class ingameSingleRuneData {
175
+ champion?: simpleChampionData;
176
+ perks: cDragonPerkInfo[];
177
+ name: string;
178
+ team: number;
179
+ }
180
+
181
+ /**
182
+ * This is an auto-generated file.
183
+ * Any changes made to this file can be lost when this file is regenerated.
184
+ */
185
+
186
+ declare class ingameRuneData {
187
+ runes: ingameSingleRuneData[];
188
+ }
189
+
190
+ /**
191
+ * This is an auto-generated file.
192
+ * Any changes made to this file can be lost when this file is regenerated.
193
+ */
194
+
195
+ declare class ingameScoreboardBottomPlayerData {
196
+ champion?: simpleChampionData;
197
+ name: string;
198
+ kills: number;
199
+ deaths: number;
200
+ assists: number;
201
+ level: number;
202
+ gold: number;
203
+ totalGold: number;
204
+ creepScore: number;
205
+ visionScore: number;
206
+ shutdown: number;
207
+ respawnTimeRemaining?: number;
208
+ items?: itemWithAsset[];
209
+ }
210
+
211
+ /**
212
+ * This is an auto-generated file.
213
+ * Any changes made to this file can be lost when this file is regenerated.
214
+ */
215
+
216
+ declare class ingameScoreboardBottomTeamData {
217
+ id: string;
218
+ name: string;
219
+ tag: string;
220
+ players: ingameScoreboardBottomPlayerData[];
221
+ }
222
+
223
+ /**
224
+ * This is an auto-generated file.
225
+ * Any changes made to this file can be lost when this file is regenerated.
226
+ */
227
+
228
+ declare class ingameScoreboardBottomData {
229
+ gameTime: number;
230
+ teams: ingameScoreboardBottomTeamData[];
231
+ }
232
+
233
+ /**
234
+ * This is an auto-generated file.
235
+ * Any changes made to this file can be lost when this file is regenerated.
236
+ */
237
+ declare enum BestOfType {
238
+ BestOf1 = 1,
239
+ BestOf2 = 2,
240
+ BestOf3 = 3,
241
+ BestOf5 = 5,
242
+ BestOf7 = 7
243
+ }
244
+
245
+ /**
246
+ * This is an auto-generated file.
247
+ * Any changes made to this file can be lost when this file is regenerated.
248
+ */
249
+ declare class ingameObjectivePowerPlay {
250
+ gold: number;
251
+ kills: number;
252
+ deaths: number;
253
+ timeStart: number;
254
+ timeEnd: number;
255
+ }
256
+
257
+ /**
258
+ * This is an auto-generated file.
259
+ * Any changes made to this file can be lost when this file is regenerated.
260
+ */
261
+ declare class teamScore {
262
+ wins: number;
263
+ losses: number;
264
+ }
265
+
266
+ /**
267
+ * This is an auto-generated file.
268
+ * Any changes made to this file can be lost when this file is regenerated.
269
+ */
270
+
271
+ declare class ingameScoreboardTeamData {
272
+ teamName: string;
273
+ teamTag: string;
274
+ teamIconUrl: string;
275
+ seriesScore: teamScore;
276
+ totalScore: teamScore;
277
+ infoText: string;
278
+ gold: number;
279
+ kills: number;
280
+ towers: number;
281
+ towerPlates: number;
282
+ grubs: number;
283
+ dragons: string[];
284
+ baronPowerPlay?: ingameObjectivePowerPlay;
285
+ dragonPowerPlay?: ingameObjectivePowerPlay;
286
+ }
287
+
288
+ /**
289
+ * This is an auto-generated file.
290
+ * Any changes made to this file can be lost when this file is regenerated.
291
+ */
292
+
293
+ declare class ingameScoreboardData {
294
+ teams: ingameScoreboardTeamData[];
295
+ gameTime: number;
296
+ bestOf: BestOfType;
297
+ }
298
+
299
+ /**
300
+ * This is an auto-generated file.
301
+ * Any changes made to this file can be lost when this file is regenerated.
302
+ */
303
+ declare class ingameSideInfoPageDisplayData {
304
+ showHero: boolean;
305
+ showMinValue: boolean;
306
+ showCurValue: boolean;
307
+ showMaxValue: boolean;
308
+ showBar: boolean;
309
+ }
310
+
311
+ /**
312
+ * This is an auto-generated file.
313
+ * Any changes made to this file can be lost when this file is regenerated.
314
+ */
315
+
316
+ declare class ingameSideInfoPageRow {
317
+ champion?: simpleChampionData;
318
+ playerName?: string;
319
+ team?: number;
320
+ minValue?: number;
321
+ curValue?: number;
322
+ displayValue?: number;
323
+ maxValue?: number;
324
+ }
325
+
326
+ /**
327
+ * This is an auto-generated file.
328
+ * Any changes made to this file can be lost when this file is regenerated.
329
+ */
330
+ declare enum IngameSideInfoPageType {
331
+ Gold = 1,
332
+ Experience = 2,
333
+ CreepScore = 4,
334
+ Damage = 8,
335
+ None = 16
336
+ }
337
+
338
+ /**
339
+ * This is an auto-generated file.
340
+ * Any changes made to this file can be lost when this file is regenerated.
341
+ */
342
+
343
+ declare class ingameSideInfoPage {
344
+ type: IngameSideInfoPageType;
345
+ title: string;
346
+ players: ingameSideInfoPageRow[];
347
+ display: ingameSideInfoPageDisplayData;
348
+ }
349
+
350
+ /**
351
+ * This is an auto-generated file.
352
+ * Any changes made to this file can be lost when this file is regenerated.
353
+ */
354
+ declare class ingameExperienceData {
355
+ previousLevel: number;
356
+ current: number;
357
+ nextLevel: number;
358
+ }
359
+
360
+ /**
361
+ * This is an auto-generated file.
362
+ * Any changes made to this file can be lost when this file is regenerated.
363
+ */
364
+ declare class ingameHealthData {
365
+ current: number;
366
+ max: number;
367
+ shield: number;
368
+ physicalShield: number;
369
+ magicalShield: number;
370
+ }
371
+
372
+ /**
373
+ * This is an auto-generated file.
374
+ * Any changes made to this file can be lost when this file is regenerated.
375
+ */
376
+ declare enum ResourceType {
377
+ mana = 0,
378
+ energy = 1,
379
+ none = 2,
380
+ shield = 3,
381
+ battlefury = 4,
382
+ dragonfury = 5,
383
+ rage = 6,
384
+ heat = 7,
385
+ gnarfury = 8,
386
+ ferocity = 9,
387
+ bloodwell = 10,
388
+ wind = 11,
389
+ ammo = 12,
390
+ moonlight = 13,
391
+ other = 14,
392
+ unknown = 255
393
+ }
394
+
395
+ /**
396
+ * This is an auto-generated file.
397
+ * Any changes made to this file can be lost when this file is regenerated.
398
+ */
399
+
400
+ declare class ingameResourceData {
401
+ type: ResourceType;
402
+ current: number;
403
+ max: number;
404
+ }
405
+
406
+ /**
407
+ * This is an auto-generated file.
408
+ * Any changes made to this file can be lost when this file is regenerated.
409
+ */
410
+ declare class perkInfoV2 {
411
+ iconHash?: string;
412
+ id: number;
413
+ name: string;
414
+ iconPath: string;
415
+ }
416
+
417
+ /**
418
+ * This is an auto-generated file.
419
+ * Any changes made to this file can be lost when this file is regenerated.
420
+ */
421
+
422
+ declare class tabPlayer {
423
+ id: string;
424
+ playerName: string;
425
+ playerHashtag: string;
426
+ championAssets?: simpleChampionData;
427
+ abilities: ingameAbilityInfo[];
428
+ perks: perkInfoV2[];
429
+ health: ingameHealthData;
430
+ resource: ingameResourceData;
431
+ stacksData?: number;
432
+ hasBaron: boolean;
433
+ hasElder: boolean;
434
+ level: number;
435
+ experience: ingameExperienceData;
436
+ timeToRespawn?: number;
437
+ }
438
+
439
+ /**
440
+ * This is an auto-generated file.
441
+ * Any changes made to this file can be lost when this file is regenerated.
442
+ */
443
+
444
+ declare class tabTeam {
445
+ id: number;
446
+ players: tabPlayer[];
447
+ }
448
+
449
+ /**
450
+ * This is an auto-generated file.
451
+ * Any changes made to this file can be lost when this file is regenerated.
452
+ */
453
+ declare enum CampLocation {
454
+ DragonPit = 2,
455
+ BaronPit = 3
456
+ }
457
+
458
+ /**
459
+ * This is an auto-generated file.
460
+ * Any changes made to this file can be lost when this file is regenerated.
461
+ */
462
+ declare enum IngameObjectiveType {
463
+ GRUB = 0,
464
+ HERALD = 1,
465
+ BARON = 4,
466
+ DRAGON_WATER = 5,
467
+ DRAGON_AIR = 6,
468
+ DRAGON_EARTH = 7,
469
+ DRAGON_FIRE = 8,
470
+ DRAGON_HEXTECH = 9,
471
+ DRAGON_CHEMTECH = 10,
472
+ DRAGON_ELDER = 11,
473
+ INHIBITOR_L0 = 12,
474
+ INHIBITOR_L1 = 13,
475
+ INHIBITOR_L2 = 14,
476
+ UNDEFINED = 32767
477
+ }
478
+
479
+ /**
480
+ * This is an auto-generated file.
481
+ * Any changes made to this file can be lost when this file is regenerated.
482
+ */
483
+
484
+ interface iObjectiveRespawnData {
485
+ type: IngameObjectiveType;
486
+ timeDestroy: number;
487
+ timeAlive?: number;
488
+ mapSide?: CampLocation;
489
+ }
490
+
491
+ /**
492
+ * This is an auto-generated file.
493
+ * Any changes made to this file can be lost when this file is regenerated.
494
+ */
495
+
496
+ declare class teamInhibitorData {
497
+ team: string;
498
+ teamid: number;
499
+ side: number;
500
+ inhibitors: {
501
+ [key: string]: iObjectiveRespawnData;
502
+ };
503
+ }
504
+
505
+ /**
506
+ * This is an auto-generated file.
507
+ * Any changes made to this file can be lost when this file is regenerated.
508
+ */
509
+ declare enum TeamMemberRole {
510
+ Unknown = 0,
511
+ Player = 1,
512
+ Coach = 2,
513
+ Manager = 3,
514
+ Analyst = 4,
515
+ Substitute = 5
516
+ }
517
+
518
+ /**
519
+ * This is an auto-generated file.
520
+ * Any changes made to this file can be lost when this file is regenerated.
521
+ */
522
+
523
+ declare class teamMember {
524
+ memberId: number;
525
+ teamId: number;
526
+ alias: string;
527
+ puuid: string;
528
+ isActive: boolean;
529
+ tag: string;
530
+ iconUri?: string;
531
+ role: TeamMemberRole;
532
+ familyName: string;
533
+ givenName: string;
534
+ }
535
+
536
+ /**
537
+ * This is an auto-generated file.
538
+ * Any changes made to this file can be lost when this file is regenerated.
539
+ */
540
+
541
+ declare class teamWithMembers {
542
+ members: teamMember[];
543
+ teamId: number;
544
+ name: string;
545
+ tag: string;
546
+ description?: string;
547
+ iconUri?: string;
548
+ isActive: boolean;
549
+ primaryColor?: number;
550
+ secondaryColor?: number;
551
+ tertiaryColor?: number;
552
+ backgroundColor?: number;
553
+ }
554
+
555
+ /**
556
+ * This is an auto-generated file.
557
+ * Any changes made to this file can be lost when this file is regenerated.
558
+ */
559
+
560
+ declare class ingameFrontendData {
561
+ gameTime: number;
562
+ playbackSpeed: number;
563
+ isTestingEnvironment?: boolean;
564
+ gameVersion: string;
565
+ patch?: string;
566
+ teams?: teamWithMembers[];
567
+ gameStatus: GameState$1;
568
+ scoreboard?: ingameScoreboardData;
569
+ tabs?: {
570
+ [key: string]: tabTeam;
571
+ };
572
+ scoreboardBottom?: ingameScoreboardBottomData;
573
+ baronPitTimer?: iObjectiveRespawnData;
574
+ dragonPitTimer?: iObjectiveRespawnData;
575
+ inhibitors?: teamInhibitorData[];
576
+ sideInfoPage?: ingameSideInfoPage;
577
+ goldGraph?: ingameGoldGraphData;
578
+ runes?: ingameRuneData;
579
+ damageGraph?: ingameDamageGraphData;
580
+ teamfightDamageOverview?: ingameDamageGraphData;
581
+ }
582
+
583
+ /**
584
+ * This is an auto-generated file.
585
+ * Any changes made to this file can be lost when this file is regenerated.
586
+ */
587
+ declare enum GameState {
588
+ OutOfGame = 0,
589
+ Loading = 1,
590
+ Running = 2,
591
+ Paused = 3,
592
+ Mocking = 4,
593
+ GameOver = 5,
594
+ ChampionSelect = 6
595
+ }
596
+
597
+ /**
598
+ * A subscribable slice of state produced by `select()`.
599
+ *
600
+ * Compatible with:
601
+ * - React 18+ `useSyncExternalStore(slice.subscribe, slice.getSnapshot)`
602
+ * - Vue `watchEffect(() => slice.getSnapshot())`
603
+ * - Svelte `readable` / custom store contract
604
+ * - Solid `createEffect(() => slice.getSnapshot())`
605
+ * - Vanilla JS `slice.subscribe(() => console.log(slice.getSnapshot()))`
606
+ */
607
+ interface Subscribable<T> {
608
+ /** Register a listener that fires when the selected value changes. Returns an unsubscribe function. */
609
+ subscribe(listener: () => void): () => void;
610
+ /** Return the current value of this slice. */
611
+ getSnapshot(): T;
612
+ }
613
+ /** Equality function used to compare snapshots. */
614
+ type EqualityFn<T> = (a: T, b: T) => boolean;
615
+ /**
616
+ * Reactive store for League Broadcast game state.
617
+ *
618
+ * The store holds an immutable snapshot that is replaced on every update.
619
+ * Fine-grained subscriptions are achieved through **selectors**: a selector
620
+ * derives a slice of the full state and only notifies listeners when the
621
+ * derived value actually changes (compared with a configurable equality
622
+ * function — shallow reference equality by default).
623
+ *
624
+ * @example Vanilla JS
625
+ * ```ts
626
+ * const scoreboard = store.select(s => s.scoreboard);
627
+ * scoreboard.subscribe(() => {
628
+ * console.log('Scoreboard changed:', scoreboard.getSnapshot());
629
+ * });
630
+ * ```
631
+ *
632
+ * @example React 18+
633
+ * ```tsx
634
+ * function Scoreboard() {
635
+ * const scoreboard = useSyncExternalStore(
636
+ * store.select(s => s.scoreboard).subscribe,
637
+ * store.select(s => s.scoreboard).getSnapshot,
638
+ * );
639
+ * return <div>{scoreboard?.teams[0]?.kills}</div>;
640
+ * }
641
+ * // — or use the provided useGameState hook (see docs)
642
+ * ```
643
+ *
644
+ * @example Vue 3
645
+ * ```ts
646
+ * const kills = useGameStateRef(store, s => s.scoreboard?.teams[0]?.kills);
647
+ * ```
648
+ */
649
+ declare class GameStateStore {
650
+ /** Current immutable snapshot. Replaced (never mutated) on every update. */
651
+ private snapshot;
652
+ /** Global listeners — called on every state change regardless of selector. */
653
+ private listeners;
654
+ /** Monotonically increasing version — used for cheap stale checks. */
655
+ private version;
656
+ constructor(initialState: ingameFrontendData, initialGameState: GameState);
657
+ /** Return the current full snapshot. */
658
+ getSnapshot(): GameStateSnapshot;
659
+ /** Return the current version number. */
660
+ getVersion(): number;
661
+ /**
662
+ * Subscribe to **all** state changes (unfiltered).
663
+ * Returns an unsubscribe function.
664
+ *
665
+ * This satisfies the `subscribe` half of `useSyncExternalStore` when
666
+ * combined with `getSnapshot`.
667
+ */
668
+ subscribe(listener: () => void): () => void;
669
+ /**
670
+ * Create a **subscribable slice** that only triggers when the selected
671
+ * value changes according to `equalityFn` (defaults to `===`).
672
+ *
673
+ * The returned object satisfies the `useSyncExternalStore` contract and
674
+ * can also be used with `watch()` for callback-style subscriptions.
675
+ *
676
+ * Selector instances are lightweight — create them freely (e.g. inside
677
+ * render functions). Referential identity of the *selector function* is
678
+ * **not** required to be stable.
679
+ */
680
+ select<S>(selector: (snapshot: GameStateSnapshot) => S, equalityFn?: EqualityFn<S>): Subscribable<S>;
681
+ /**
682
+ * Watch a derived value and invoke `callback` whenever it changes.
683
+ * Returns an unsubscribe function.
684
+ *
685
+ * This is the simplest API for imperative / vanilla-JS usage:
686
+ *
687
+ * ```ts
688
+ * store.watch(
689
+ * s => s.gameData.scoreboard?.teams[0]?.kills,
690
+ * kills => console.log('Blue kills:', kills),
691
+ * );
692
+ * ```
693
+ */
694
+ watch<S>(selector: (snapshot: GameStateSnapshot) => S, callback: (value: S, prev: S) => void, equalityFn?: EqualityFn<S>): () => void;
695
+ /**
696
+ * Watch a derived value and invoke `callback` whenever it changes,
697
+ * **and** invoke it immediately with the current value.
698
+ */
699
+ watchImmediate<S>(selector: (snapshot: GameStateSnapshot) => S, callback: (value: S, prev: S | undefined) => void, equalityFn?: EqualityFn<S>): () => void;
700
+ /** @internal Replace game data snapshot and notify listeners. */
701
+ _setGameData(data: ingameFrontendData): void;
702
+ /** @internal Replace game state and notify listeners. */
703
+ _setGameState(state: GameState): void;
704
+ /** @internal Replace entire snapshot (used on game end / reset). */
705
+ _reset(data: ingameFrontendData, state: GameState): void;
706
+ private emit;
707
+ }
708
+ interface GameStateSnapshot {
709
+ readonly gameData: ingameFrontendData;
710
+ readonly gameState: GameState;
711
+ /** Monotonic version counter — useful for cheap stale checks. */
712
+ readonly version: number;
713
+ }
714
+ /**
715
+ * Shallow-compare two objects by their own enumerable keys.
716
+ * Useful as `equalityFn` when selecting an object whose identity changes
717
+ * on every update but whose contents may not (e.g. `{ kills: 3, deaths: 1 }`).
718
+ */
719
+ declare function shallowEqual<T>(a: T, b: T): boolean;
720
+
721
+ /**
722
+ * This is an auto-generated file.
723
+ * Any changes made to this file can be lost when this file is regenerated.
724
+ */
725
+
726
+ declare class playerUpdateEvent {
727
+ playerNameAndTagLine: string;
728
+ guid: string;
729
+ boughtItems?: itemWithAsset[];
730
+ soldOrConsumedItems?: itemWithAsset[];
731
+ levelUp?: number[];
732
+ kills: number;
733
+ deaths: number;
734
+ assists: number;
735
+ }
736
+
737
+ /**
738
+ * This is an auto-generated file.
739
+ * Any changes made to this file can be lost when this file is regenerated.
740
+ */
741
+ declare class teamUpdateResults {
742
+ teamId: number;
743
+ platesTaken: number;
744
+ turretsTaken: number;
745
+ inhibitorsTaken: number;
746
+ }
747
+
748
+ /**
749
+ * This is an auto-generated file.
750
+ * Any changes made to this file can be lost when this file is regenerated.
751
+ */
752
+ declare class ingameObjectiveEvent {
753
+ objective: string;
754
+ eventType: string;
755
+ killer?: string;
756
+ assisters?: string[];
757
+ team: number;
758
+ }
759
+
760
+ /**
761
+ * This is an auto-generated file.
762
+ * Any changes made to this file can be lost when this file is regenerated.
763
+ */
764
+
765
+ declare class announcementParameter {
766
+ champion?: simpleChampionData;
767
+ member?: teamMember;
768
+ asset?: string;
769
+ team: number;
770
+ }
771
+
772
+ /**
773
+ * This is an auto-generated file.
774
+ * Any changes made to this file can be lost when this file is regenerated.
775
+ */
776
+ declare enum AnnouncementType {
777
+ Unknown = 0,
778
+ Kill = 1,
779
+ FirstBlood = 2,
780
+ FirstBrick = 3,
781
+ DoubleKill = 4,
782
+ TripleKill = 5,
783
+ QuadraKill = 6,
784
+ PentaKill = 7,
785
+ Ace = 8,
786
+ BaronKill = 9,
787
+ DragonKill = 10,
788
+ HeraldKill = 11,
789
+ GrubKill = 12,
790
+ InhibitorKill = 13,
791
+ TowerKill = 14,
792
+ BaronSpawn = 15,
793
+ DragonSpawn = 16,
794
+ HeraldSpawn = 17,
795
+ GrubSpawn = 18,
796
+ InhibitorSpawn = 19,
797
+ TowerSpawn = 20,
798
+ BaronSteal = 21,
799
+ DragonSteal = 22,
800
+ HeraldSteal = 23,
801
+ GrubSteal = 24,
802
+ Dragon_Rift_Air = 25,
803
+ Dragon_Rift_Earth = 26,
804
+ Dragon_Rift_Fire = 27,
805
+ Dragon_Rift_Water = 28,
806
+ Dragon_Rift_Hextech = 29,
807
+ Dragon_Rift_Chemtech = 30,
808
+ GameStart = 31,
809
+ MinionSpawn = 32
810
+ }
811
+
812
+ /**
813
+ * This is an auto-generated file.
814
+ * Any changes made to this file can be lost when this file is regenerated.
815
+ */
816
+
817
+ declare class announcerEvent {
818
+ source?: announcementParameter;
819
+ target?: announcementParameter;
820
+ type: AnnouncementType;
821
+ }
822
+
823
+ /**
824
+ * This is an auto-generated file.
825
+ * Any changes made to this file can be lost when this file is regenerated.
826
+ */
827
+
828
+ declare class killFeedEvent {
829
+ ingameTeamId: number;
830
+ killer?: simpleChampionData;
831
+ victim: simpleChampionData;
832
+ assisters?: simpleChampionData[];
833
+ }
834
+
835
+ /**
836
+ * This is an auto-generated file.
837
+ * Any changes made to this file can be lost when this file is regenerated.
838
+ */
839
+ declare enum Team {
840
+ None = 0,
841
+ Order = 1,
842
+ Chaos = 2,
843
+ Neutral = 3
844
+ }
845
+
846
+ interface LeagueBroadcastClientConfig {
847
+ host: string;
848
+ port?: number;
849
+ wsRoute?: string;
850
+ apiRoute?: string;
851
+ cacheRoute?: string;
852
+ useHttps?: boolean;
853
+ autoConnect?: boolean;
854
+ }
855
+ interface GameDataEventHandlers {
856
+ onPlayerEvent?: (event: playerUpdateEvent) => void;
857
+ onTeamEvent?: (event: teamUpdateResults) => void;
858
+ onObjectiveEvent?: (event: ingameObjectiveEvent) => void;
859
+ onFirstTowerEvent?: (teamId: Team) => void;
860
+ onAnnouncementEvent?: (event: announcerEvent) => void;
861
+ onKillFeedEvent?: (event: killFeedEvent) => void;
862
+ }
863
+ /**
864
+ * Main client for connecting to League Broadcast backend and receiving game data
865
+ */
866
+ declare class LeagueBroadcastClient {
867
+ private ws;
868
+ private config;
869
+ private gameData;
870
+ private gameState;
871
+ private isTestingEnvironment;
872
+ /** Reactive store — subscribe to fine-grained state slices. */
873
+ readonly store: GameStateStore;
874
+ private stateUpdateHandlers;
875
+ private gameStatusHandlers;
876
+ private eventHandlers;
877
+ constructor(config: LeagueBroadcastClientConfig);
878
+ /**
879
+ * Connect to the League Broadcast backend
880
+ */
881
+ connect(): Promise<void>;
882
+ /**
883
+ * Disconnect from the League Broadcast backend
884
+ */
885
+ disconnect(): void;
886
+ /**
887
+ * Check if connected to the backend
888
+ */
889
+ isConnected(): boolean;
890
+ /**
891
+ * Get the current game data
892
+ */
893
+ getGameData(): ingameFrontendData;
894
+ /**
895
+ * Get the current game state
896
+ */
897
+ getGameState(): GameState$1;
898
+ /**
899
+ * Check if in testing environment
900
+ */
901
+ isInTestingEnvironment(): boolean;
902
+ /**
903
+ * Register a handler for state updates
904
+ */
905
+ onStateUpdate(handler: (state: ingameFrontendData) => void): () => void;
906
+ /**
907
+ * Register a handler for game status changes
908
+ */
909
+ onGameStatusChange(handler: (status: GameState$1, isTestingEnv: boolean) => void): () => void;
910
+ /**
911
+ * Register handlers for game events
912
+ */
913
+ onGameEvents(handlers: GameDataEventHandlers): void;
914
+ /**
915
+ * Register a handler for connection events
916
+ */
917
+ onConnect(handler: () => void): () => void;
918
+ /**
919
+ * Register a handler for disconnection events
920
+ */
921
+ onDisconnect(handler: () => void): () => void;
922
+ /**
923
+ * Register a handler for error events
924
+ */
925
+ onError(handler: (error: Event) => void): () => void;
926
+ /**
927
+ * Create a subscribable slice of game state.
928
+ * The slice only notifies listeners when the selected value actually changes.
929
+ *
930
+ * Works directly with React 18+ `useSyncExternalStore`:
931
+ * ```tsx
932
+ * const kills = client.select(s => s.gameData.scoreboard?.teams[0]?.kills);
933
+ * function Kills() {
934
+ * const value = useSyncExternalStore(kills.subscribe, kills.getSnapshot);
935
+ * return <span>{value}</span>;
936
+ * }
937
+ * ```
938
+ */
939
+ select<S>(selector: (snapshot: GameStateSnapshot) => S, equalityFn?: EqualityFn<S>): Subscribable<S>;
940
+ /**
941
+ * Watch a derived value and invoke `callback` whenever it changes.
942
+ * Returns an unsubscribe function.
943
+ *
944
+ * ```ts
945
+ * client.watch(
946
+ * s => s.gameData.scoreboard?.teams[0]?.kills,
947
+ * (kills, prev) => console.log(`Kills: ${prev} → ${kills}`),
948
+ * );
949
+ * ```
950
+ */
951
+ watch<S>(selector: (snapshot: GameStateSnapshot) => S, callback: (value: S, prev: S) => void, equalityFn?: EqualityFn<S>): () => void;
952
+ /**
953
+ * Get the base HTTP URL for API requests
954
+ */
955
+ getApiUrl(): string;
956
+ /**
957
+ * Get the base URL for cache requests
958
+ */
959
+ getCacheUrl(path?: string): string;
960
+ /**
961
+ * Setup message handler for WebSocket messages
962
+ */
963
+ private setupMessageHandler;
964
+ /**
965
+ * Handle state update from backend
966
+ */
967
+ private handleStateUpdate;
968
+ /**
969
+ * Handle game status update
970
+ */
971
+ private handleGameStatusUpdate;
972
+ /**
973
+ * Handle game events
974
+ */
975
+ private handleGameEvents;
976
+ /**
977
+ * End the game and reset state
978
+ */
979
+ private endGame;
980
+ }
981
+
982
+ /**
983
+ * WebSocket connection manager for League Broadcast backend
984
+ */
985
+ declare class WebSocketManager {
986
+ private socket;
987
+ private url;
988
+ private reconnectAttempts;
989
+ private maxReconnectAttempts;
990
+ private reconnectDelay;
991
+ private reconnectTimeout;
992
+ private messageHandlers;
993
+ private connectionHandlers;
994
+ private disconnectionHandlers;
995
+ private errorHandlers;
996
+ /**
997
+ * Connect to the WebSocket server
998
+ */
999
+ connect(url: string): Promise<void>;
1000
+ /**
1001
+ * Disconnect from the WebSocket server
1002
+ */
1003
+ disconnect(): void;
1004
+ /**
1005
+ * Check if connected to the WebSocket server
1006
+ */
1007
+ isConnected(): boolean;
1008
+ /**
1009
+ * Send a message to the server
1010
+ */
1011
+ send(message: string | object): void;
1012
+ /**
1013
+ * Register a message handler
1014
+ */
1015
+ onMessage(handler: (data: any) => void): () => void;
1016
+ /**
1017
+ * Register a connection handler
1018
+ */
1019
+ onConnect(handler: () => void): () => void;
1020
+ /**
1021
+ * Register a disconnection handler
1022
+ */
1023
+ onDisconnect(handler: () => void): () => void;
1024
+ /**
1025
+ * Register an error handler
1026
+ */
1027
+ onError(handler: (error: Event) => void): () => void;
1028
+ /**
1029
+ * Attempt to reconnect to the server
1030
+ */
1031
+ private attemptReconnect;
1032
+ /**
1033
+ * Clean up resources
1034
+ */
1035
+ private cleanup;
1036
+ }
1037
+
1038
+ /**
1039
+ * This is an auto-generated file.
1040
+ * Any changes made to this file can be lost when this file is regenerated.
1041
+ */
1042
+
1043
+ declare class transitionEvents {
1044
+ player?: playerUpdateEvent[];
1045
+ team?: teamUpdateResults[];
1046
+ objective?: ingameObjectiveEvent[];
1047
+ firstTower?: Team;
1048
+ announcements?: announcerEvent[];
1049
+ killFeed?: killFeedEvent[];
1050
+ }
1051
+
1052
+ export { type EqualityFn, type GameDataEventHandlers, GameState$1 as GameState, type GameStateSnapshot, GameStateStore, LeagueBroadcastClient, type LeagueBroadcastClientConfig, type Subscribable, WebSocketManager, announcerEvent, ingameFrontendData, ingameObjectiveEvent, killFeedEvent, playerUpdateEvent, shallowEqual, teamUpdateResults, transitionEvents };