@beta-gamer/angular 0.1.1 → 0.1.3

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.
package/README.md ADDED
@@ -0,0 +1,185 @@
1
+ # @beta-gamer/angular
2
+
3
+ Angular SDK for [Beta Gamer](https://beta-gamer.com) — embed multiplayer games into your app as standalone components. You control the layout, we handle the game logic, matchmaking, and real-time sync.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @beta-gamer/angular
9
+ ```
10
+
11
+ ## Requirements
12
+
13
+ - Angular 16+
14
+ - A Beta Gamer tenant account and API key → [beta-gamer.com](https://beta-gamer.com)
15
+
16
+ ## Quick start
17
+
18
+ **1. Create a session from your backend** (never expose your API key on the client)
19
+
20
+ ```ts
21
+ const res = await fetch('https://api.beta-gamer.com/v1/sessions', {
22
+ method: 'POST',
23
+ headers: {
24
+ 'Authorization': 'Bearer bg_live_xxxx',
25
+ 'Content-Type': 'application/json',
26
+ },
27
+ body: JSON.stringify({
28
+ game: 'chess',
29
+ matchType: 'matchmaking',
30
+ players: [{ id: 'user_123', displayName: 'Alex' }],
31
+ }),
32
+ });
33
+ const { sessionToken } = await res.json();
34
+ ```
35
+
36
+ **2. Initialise the service and render a board**
37
+
38
+ ```ts
39
+ // app.component.ts
40
+ import { Component, inject, OnInit } from '@angular/core';
41
+ import { BetaGamerService, ChessBoardComponent } from '@beta-gamer/angular';
42
+
43
+ @Component({
44
+ standalone: true,
45
+ imports: [ChessBoardComponent],
46
+ template: `
47
+ <bg-chess-board
48
+ style="width:100%;height:500px"
49
+ [showCoords]="true"
50
+ [showLastMove]="true"
51
+ [showLegalMoves]="true"
52
+ orientation="auto"
53
+ (onLeave)="handleLeave()"
54
+ />
55
+ `,
56
+ })
57
+ export class AppComponent implements OnInit {
58
+ private svc = inject(BetaGamerService);
59
+
60
+ ngOnInit() {
61
+ this.svc.init('<SESSION_TOKEN>', 'https://api.beta-gamer.com');
62
+ }
63
+
64
+ handleLeave() {
65
+ // navigate away or show a lobby screen
66
+ }
67
+ }
68
+ ```
69
+
70
+ ## Service
71
+
72
+ ### `BetaGamerService`
73
+
74
+ Injectable service — call `init()` once with the session token.
75
+
76
+ ```ts
77
+ svc.init(token: string, serverUrl?: string, socketPath?: string, connectSocket?: boolean)
78
+ ```
79
+
80
+ > **`connectSocket`** (default `true`) — set to `false` when using only board components. Board components load the game in an iframe with their own socket. A second socket with the same token causes duplicate connections and AFK/turn bugs.
81
+
82
+ | Signal | Type | Description |
83
+ |--------|------|-------------|
84
+ | `svc.session` | `Signal<Session>` | Current session (game, matchType, players) |
85
+ | `svc.gameState` | `Signal<GameState>` | Live game state (status, winner, reason) |
86
+ | `svc.token` | `string` | Raw JWT session token |
87
+ | `svc.socket` | `Socket` | Raw Socket.IO socket for custom events |
88
+
89
+ ## Components
90
+
91
+ All components are standalone — import only what you need.
92
+
93
+ ### Shared (all games)
94
+
95
+ | Component | Selector | Inputs | Description |
96
+ |-----------|----------|--------|-------------|
97
+ | `PlayerCardComponent` | `<bg-player-card>` | `[player]` (`"self"` \| `"opponent"`) | Player name + active-turn indicator |
98
+ | `TimerComponent` | `<bg-timer>` | `[player]`, `[initialSeconds]?` | Live countdown clock |
99
+
100
+ ### Chess — `ChessBoardComponent`
101
+
102
+ Selector: `<bg-chess-board>`
103
+
104
+ | Input | Type | Default | Description |
105
+ |-------|------|---------|-------------|
106
+ | `[serverUrl]` | `string` | `'https://api.beta-gamer.com'` | Base URL of the Beta Gamer server |
107
+ | `[showAfkWarning]` | `boolean` | `true` | Show the built-in AFK countdown banner |
108
+ | `[showCoords]` | `boolean` | `true` | Show rank/file labels (a–h, 1–8) around the board |
109
+ | `[showLastMove]` | `boolean` | `true` | Highlight the from/to squares of the last move |
110
+ | `[showLegalMoves]` | `boolean` | `true` | Show dots on squares where the selected piece can legally move |
111
+ | `[orientation]` | `'white' \| 'black' \| 'auto'` | `'auto'` | Which color is at the bottom. `'auto'` uses the color assigned in `game:started` |
112
+ | `(onLeave)` | `EventEmitter<void>` | — | Emitted when the player taps Leave or exits the game-over modal |
113
+
114
+ ### Checkers — `CheckersBoardComponent`
115
+
116
+ Selector: `<bg-checkers-board>`
117
+
118
+ | Input | Type | Default | Description |
119
+ |-------|------|---------|-------------|
120
+ | `[serverUrl]` | `string` | `'https://api.beta-gamer.com'` | Base URL of the Beta Gamer server |
121
+ | `[showAfkWarning]` | `boolean` | `true` | Show the built-in AFK countdown banner |
122
+ | `[showLastMove]` | `boolean` | `true` | Highlight the from/to squares of the last move |
123
+ | `[orientation]` | `'red' \| 'black' \| 'auto'` | `'auto'` | Which color is at the bottom. `'auto'` uses the color assigned in `game:started` |
124
+ | `(onLeave)` | `EventEmitter<void>` | — | Emitted when the player taps Leave or exits the game-over modal |
125
+
126
+ ### Connect 4 — `Connect4BoardComponent`
127
+
128
+ Selector: `<bg-connect4-board>`
129
+
130
+ | Input | Type | Default | Description |
131
+ |-------|------|---------|-------------|
132
+ | `[serverUrl]` | `string` | `'https://api.beta-gamer.com'` | Base URL of the Beta Gamer server |
133
+ | `[showAfkWarning]` | `boolean` | `true` | Show the built-in AFK countdown banner |
134
+ | `(onLeave)` | `EventEmitter<void>` | — | Emitted when the player taps Leave or exits the game-over modal |
135
+
136
+ ### Tic-tac-toe — `TictactoeBoardComponent`
137
+
138
+ Selector: `<bg-tictactoe-board>`
139
+
140
+ | Input | Type | Default | Description |
141
+ |-------|------|---------|-------------|
142
+ | `[serverUrl]` | `string` | `'https://api.beta-gamer.com'` | Base URL of the Beta Gamer server |
143
+ | `[showAfkWarning]` | `boolean` | `true` | Show the built-in AFK countdown banner |
144
+ | `(onLeave)` | `EventEmitter<void>` | — | Emitted when the player taps Leave or exits the game-over modal |
145
+
146
+ ### Other components
147
+
148
+ | Component | Selector | Inputs | Game |
149
+ |-----------|----------|--------|------|
150
+ | `ChessMoveHistoryComponent` | `<bg-chess-move-history>` | — | chess |
151
+ | `ChessCapturedPiecesComponent` | `<bg-chess-captured-pieces>` | `[player]` | chess |
152
+ | `Connect4ScoreComponent` | `<bg-connect4-score>` | — | connect4 |
153
+ | `SubwayRunnerGameComponent` | `<bg-subway-runner-game>` | — | subway-runner |
154
+ | `SubwayRunnerScoreComponent` | `<bg-subway-runner-score>` | — | subway-runner |
155
+ | `SubwayRunnerLivesComponent` | `<bg-subway-runner-lives>` | — | subway-runner |
156
+
157
+ > **`[showAfkWarning]`** (default `true`) — set to `false` to hide the built-in AFK countdown banner and implement your own using the `{game}:afk_warning` / `{game}:afk_warning_cleared` socket events via `svc.socket`.
158
+
159
+ ## Listening to game events
160
+
161
+ ```ts
162
+ import { inject, OnInit } from '@angular/core';
163
+ import { BetaGamerService } from '@beta-gamer/angular';
164
+
165
+ export class MyComponent implements OnInit {
166
+ private svc = inject(BetaGamerService);
167
+
168
+ ngOnInit() {
169
+ this.svc.socket.on('chess:afk_warning', ({ playerId, secondsRemaining }) => {
170
+ console.log('AFK warning for', playerId, secondsRemaining);
171
+ });
172
+ }
173
+ }
174
+ ```
175
+
176
+ ## Supported games
177
+
178
+ `chess` · `checkers` · `connect4` · `tictactoe` · `subway-runner`
179
+
180
+ ## Links
181
+
182
+ - [Documentation](https://beta-gamer.com/docs)
183
+ - [Dashboard](https://beta-gamer.com/dashboard)
184
+ - [React SDK](https://www.npmjs.com/package/@beta-gamer/react)
185
+ - [React Native SDK](https://www.npmjs.com/package/@beta-gamer/react-native)
package/dist/index.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as _socket_io_component_emitter from '@socket.io/component-emitter';
2
2
  import * as _angular_core from '@angular/core';
3
- import { OnDestroy, OnInit, AfterViewInit, ElementRef } from '@angular/core';
3
+ import { OnDestroy, OnInit, AfterViewInit, EventEmitter, ElementRef } from '@angular/core';
4
4
  import { Socket } from 'socket.io-client';
5
5
 
6
6
  type GameType = 'chess' | 'checkers' | 'connect4' | 'tictactoe' | 'subway-runner';
@@ -41,23 +41,55 @@ interface GameState {
41
41
  declare class BetaGamerService implements OnDestroy {
42
42
  private _socket;
43
43
  private _token;
44
+ /** Decoded session token payload — null until `init()` is called */
44
45
  readonly session: _angular_core.WritableSignal<SessionTokenPayload | null>;
46
+ /** Live game state updated by server events */
45
47
  readonly gameState: _angular_core.WritableSignal<GameState>;
46
48
  get token(): string;
49
+ /** The active socket.io connection — available after `init()` with `connectSocket=true` */
47
50
  get socket(): Socket<_socket_io_component_emitter.DefaultEventsMap, _socket_io_component_emitter.DefaultEventsMap> | null;
48
- init(token: string, serverUrl?: string, socketPath?: string): void;
51
+ /**
52
+ * @description Initialises the service with a session token.
53
+ * Decodes the token, sets up reactive state, and optionally connects the socket.
54
+ *
55
+ * @param token - JWT session token from your backend
56
+ * @param serverUrl - Base URL of the Beta Gamer server
57
+ * @param socketPath - socket.io path (default `/socket.io`)
58
+ * @param connectSocket - Set false to skip socket connection (e.g. for SSR or testing)
59
+ */
60
+ init(token: string, serverUrl?: string, socketPath?: string, connectSocket?: boolean): void;
49
61
  ngOnDestroy(): void;
50
62
  }
51
63
 
64
+ /**
65
+ * @description Displays a player's display name and active-turn indicator.
66
+ * Styled entirely by the consumer via `data-active` and `data-player` attributes.
67
+ *
68
+ * @example
69
+ * <bg-player-card player="self" />
70
+ * <bg-player-card player="opponent" />
71
+ */
52
72
  declare class PlayerCardComponent {
73
+ /** Which player to display — `self` = players[0], `opponent` = players[1] */
53
74
  player: 'self' | 'opponent';
54
75
  private svc;
55
76
  get displayName(): string;
56
77
  get isActive(): boolean;
57
78
  }
58
79
 
80
+ /**
81
+ * @description Live countdown clock that syncs with the server via `game:clock` socket events.
82
+ * Falls back to a local 1s interval when the game is active.
83
+ * Renders a `data-low` attribute when under 30 seconds for easy CSS targeting.
84
+ *
85
+ * @example
86
+ * <bg-timer player="self" [initialSeconds]="600" />
87
+ */
88
+
59
89
  declare class TimerComponent implements OnInit, OnDestroy {
90
+ /** Which player's clock to display */
60
91
  player: 'self' | 'opponent';
92
+ /** Starting value in seconds (e.g. 600 = 10 min) */
61
93
  initialSeconds: number;
62
94
  seconds: number;
63
95
  private interval;
@@ -67,62 +99,131 @@ declare class TimerComponent implements OnInit, OnDestroy {
67
99
  ngOnDestroy(): void;
68
100
  }
69
101
 
70
- declare class ChessBoardComponent implements AfterViewInit {
102
+ /**
103
+ * @description Shared base class for all iframe-based game board components.
104
+ *
105
+ * Handles the full iframe lifecycle:
106
+ * - Injects the session token into the iframe on load via postMessage
107
+ * - Listens for `bg:leave` messages from the embed and emits `onLeave`
108
+ * - Cleans up the message listener on destroy
109
+ *
110
+ * Subclasses only need to define their embed URL and any game-specific inputs.
111
+ */
112
+
113
+ declare abstract class EmbedBoardBase implements AfterViewInit, OnDestroy {
114
+ /** Base URL of the Beta Gamer server hosting the embed pages */
71
115
  serverUrl: string;
116
+ /** Emitted when the player clicks Leave inside the embed */
117
+ onLeave: EventEmitter<void>;
72
118
  iframeRef: ElementRef<HTMLIFrameElement>;
73
- svc: BetaGamerService;
74
- get embedUrl(): string;
119
+ protected svc: BetaGamerService;
120
+ /** Subclasses return the full embed URL including query params */
121
+ abstract get embedUrl(): string;
122
+ private messageHandler;
75
123
  ngAfterViewInit(): void;
124
+ ngOnDestroy(): void;
125
+ /** Builds a query string from a params object, omitting undefined values */
126
+ protected buildQuery(params: Record<string, string | undefined>): string;
127
+ }
128
+
129
+ /**
130
+ * @description Chess board embed component.
131
+ * Renders the chess game inside an iframe served by the Beta Gamer embed server.
132
+ * Supports orientation, coordinate display, last-move highlight, and legal move hints.
133
+ */
134
+
135
+ declare class ChessBoardComponent extends EmbedBoardBase {
136
+ showAfkWarning: boolean;
137
+ showCoords: boolean;
138
+ showLastMove: boolean;
139
+ showLegalMoves: boolean;
140
+ orientation: 'white' | 'black' | 'auto';
141
+ get embedUrl(): string;
76
142
  }
143
+
144
+ /**
145
+ * @description Displays the chess move history in algebraic notation.
146
+ * Styled entirely by the consumer via the `data-role="move-history"` attribute.
147
+ */
77
148
  declare class ChessMoveHistoryComponent {
78
149
  }
150
+
151
+ /**
152
+ * @description Displays pieces captured by a given player.
153
+ * Styled entirely by the consumer via the `data-role="captured-pieces"` attribute.
154
+ */
79
155
  declare class ChessCapturedPiecesComponent {
80
156
  }
81
157
 
82
- declare class CheckersBoardComponent implements AfterViewInit {
83
- serverUrl: string;
84
- iframeRef: ElementRef<HTMLIFrameElement>;
85
- svc: BetaGamerService;
158
+ /**
159
+ * @description Checkers board embed component.
160
+ * Supports orientation (red/black/auto) and last-move highlight toggle.
161
+ */
162
+
163
+ declare class CheckersBoardComponent extends EmbedBoardBase {
164
+ showAfkWarning: boolean;
165
+ showLastMove: boolean;
166
+ orientation: 'red' | 'black' | 'auto';
86
167
  get embedUrl(): string;
87
- ngAfterViewInit(): void;
88
168
  }
89
169
 
90
- declare class Connect4BoardComponent implements AfterViewInit {
91
- serverUrl: string;
92
- iframeRef: ElementRef<HTMLIFrameElement>;
93
- svc: BetaGamerService;
170
+ /**
171
+ * @description Connect 4 board embed component.
172
+ */
173
+
174
+ declare class Connect4BoardComponent extends EmbedBoardBase {
175
+ showAfkWarning: boolean;
94
176
  get embedUrl(): string;
95
- ngAfterViewInit(): void;
96
177
  }
178
+
179
+ /**
180
+ * @description Displays the current score for each player in a Connect 4 session.
181
+ * Reads from `gameState().scores` — styled entirely by the consumer via data attributes.
182
+ */
97
183
  declare class Connect4ScoreComponent {
98
- svc: BetaGamerService;
184
+ private svc;
99
185
  get scores(): {
100
186
  id: string;
101
187
  score: unknown;
102
188
  }[];
103
189
  }
104
190
 
105
- declare class TictactoeBoardComponent implements AfterViewInit {
106
- serverUrl: string;
107
- iframeRef: ElementRef<HTMLIFrameElement>;
108
- svc: BetaGamerService;
191
+ /**
192
+ * @description Tic-tac-toe board embed component.
193
+ */
194
+
195
+ declare class TictactoeBoardComponent extends EmbedBoardBase {
196
+ showAfkWarning: boolean;
109
197
  get embedUrl(): string;
110
- ngAfterViewInit(): void;
111
198
  }
112
199
 
200
+ /**
201
+ * @description Subway Runner game embed component.
202
+ */
203
+
113
204
  declare class SubwayRunnerGameComponent implements AfterViewInit {
114
205
  serverUrl: string;
115
206
  iframeRef: ElementRef<HTMLIFrameElement>;
116
- svc: BetaGamerService;
207
+ protected svc: BetaGamerService;
117
208
  get embedUrl(): string;
118
209
  ngAfterViewInit(): void;
119
210
  }
211
+
212
+ /**
213
+ * @description Displays the current score in a Subway Runner session.
214
+ * Reads from `gameState().score`. Style via `data-role="score"`.
215
+ */
120
216
  declare class SubwayRunnerScoreComponent {
121
- svc: BetaGamerService;
217
+ private svc;
122
218
  get score(): any;
123
219
  }
220
+
221
+ /**
222
+ * @description Displays the remaining lives in a Subway Runner session.
223
+ * Reads from `gameState().lives`. Style via `data-role="lives"`.
224
+ */
124
225
  declare class SubwayRunnerLivesComponent {
125
- svc: BetaGamerService;
226
+ private svc;
126
227
  get lives(): any;
127
228
  }
128
229
 
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as _socket_io_component_emitter from '@socket.io/component-emitter';
2
2
  import * as _angular_core from '@angular/core';
3
- import { OnDestroy, OnInit, AfterViewInit, ElementRef } from '@angular/core';
3
+ import { OnDestroy, OnInit, AfterViewInit, EventEmitter, ElementRef } from '@angular/core';
4
4
  import { Socket } from 'socket.io-client';
5
5
 
6
6
  type GameType = 'chess' | 'checkers' | 'connect4' | 'tictactoe' | 'subway-runner';
@@ -41,23 +41,55 @@ interface GameState {
41
41
  declare class BetaGamerService implements OnDestroy {
42
42
  private _socket;
43
43
  private _token;
44
+ /** Decoded session token payload — null until `init()` is called */
44
45
  readonly session: _angular_core.WritableSignal<SessionTokenPayload | null>;
46
+ /** Live game state updated by server events */
45
47
  readonly gameState: _angular_core.WritableSignal<GameState>;
46
48
  get token(): string;
49
+ /** The active socket.io connection — available after `init()` with `connectSocket=true` */
47
50
  get socket(): Socket<_socket_io_component_emitter.DefaultEventsMap, _socket_io_component_emitter.DefaultEventsMap> | null;
48
- init(token: string, serverUrl?: string, socketPath?: string): void;
51
+ /**
52
+ * @description Initialises the service with a session token.
53
+ * Decodes the token, sets up reactive state, and optionally connects the socket.
54
+ *
55
+ * @param token - JWT session token from your backend
56
+ * @param serverUrl - Base URL of the Beta Gamer server
57
+ * @param socketPath - socket.io path (default `/socket.io`)
58
+ * @param connectSocket - Set false to skip socket connection (e.g. for SSR or testing)
59
+ */
60
+ init(token: string, serverUrl?: string, socketPath?: string, connectSocket?: boolean): void;
49
61
  ngOnDestroy(): void;
50
62
  }
51
63
 
64
+ /**
65
+ * @description Displays a player's display name and active-turn indicator.
66
+ * Styled entirely by the consumer via `data-active` and `data-player` attributes.
67
+ *
68
+ * @example
69
+ * <bg-player-card player="self" />
70
+ * <bg-player-card player="opponent" />
71
+ */
52
72
  declare class PlayerCardComponent {
73
+ /** Which player to display — `self` = players[0], `opponent` = players[1] */
53
74
  player: 'self' | 'opponent';
54
75
  private svc;
55
76
  get displayName(): string;
56
77
  get isActive(): boolean;
57
78
  }
58
79
 
80
+ /**
81
+ * @description Live countdown clock that syncs with the server via `game:clock` socket events.
82
+ * Falls back to a local 1s interval when the game is active.
83
+ * Renders a `data-low` attribute when under 30 seconds for easy CSS targeting.
84
+ *
85
+ * @example
86
+ * <bg-timer player="self" [initialSeconds]="600" />
87
+ */
88
+
59
89
  declare class TimerComponent implements OnInit, OnDestroy {
90
+ /** Which player's clock to display */
60
91
  player: 'self' | 'opponent';
92
+ /** Starting value in seconds (e.g. 600 = 10 min) */
61
93
  initialSeconds: number;
62
94
  seconds: number;
63
95
  private interval;
@@ -67,62 +99,131 @@ declare class TimerComponent implements OnInit, OnDestroy {
67
99
  ngOnDestroy(): void;
68
100
  }
69
101
 
70
- declare class ChessBoardComponent implements AfterViewInit {
102
+ /**
103
+ * @description Shared base class for all iframe-based game board components.
104
+ *
105
+ * Handles the full iframe lifecycle:
106
+ * - Injects the session token into the iframe on load via postMessage
107
+ * - Listens for `bg:leave` messages from the embed and emits `onLeave`
108
+ * - Cleans up the message listener on destroy
109
+ *
110
+ * Subclasses only need to define their embed URL and any game-specific inputs.
111
+ */
112
+
113
+ declare abstract class EmbedBoardBase implements AfterViewInit, OnDestroy {
114
+ /** Base URL of the Beta Gamer server hosting the embed pages */
71
115
  serverUrl: string;
116
+ /** Emitted when the player clicks Leave inside the embed */
117
+ onLeave: EventEmitter<void>;
72
118
  iframeRef: ElementRef<HTMLIFrameElement>;
73
- svc: BetaGamerService;
74
- get embedUrl(): string;
119
+ protected svc: BetaGamerService;
120
+ /** Subclasses return the full embed URL including query params */
121
+ abstract get embedUrl(): string;
122
+ private messageHandler;
75
123
  ngAfterViewInit(): void;
124
+ ngOnDestroy(): void;
125
+ /** Builds a query string from a params object, omitting undefined values */
126
+ protected buildQuery(params: Record<string, string | undefined>): string;
127
+ }
128
+
129
+ /**
130
+ * @description Chess board embed component.
131
+ * Renders the chess game inside an iframe served by the Beta Gamer embed server.
132
+ * Supports orientation, coordinate display, last-move highlight, and legal move hints.
133
+ */
134
+
135
+ declare class ChessBoardComponent extends EmbedBoardBase {
136
+ showAfkWarning: boolean;
137
+ showCoords: boolean;
138
+ showLastMove: boolean;
139
+ showLegalMoves: boolean;
140
+ orientation: 'white' | 'black' | 'auto';
141
+ get embedUrl(): string;
76
142
  }
143
+
144
+ /**
145
+ * @description Displays the chess move history in algebraic notation.
146
+ * Styled entirely by the consumer via the `data-role="move-history"` attribute.
147
+ */
77
148
  declare class ChessMoveHistoryComponent {
78
149
  }
150
+
151
+ /**
152
+ * @description Displays pieces captured by a given player.
153
+ * Styled entirely by the consumer via the `data-role="captured-pieces"` attribute.
154
+ */
79
155
  declare class ChessCapturedPiecesComponent {
80
156
  }
81
157
 
82
- declare class CheckersBoardComponent implements AfterViewInit {
83
- serverUrl: string;
84
- iframeRef: ElementRef<HTMLIFrameElement>;
85
- svc: BetaGamerService;
158
+ /**
159
+ * @description Checkers board embed component.
160
+ * Supports orientation (red/black/auto) and last-move highlight toggle.
161
+ */
162
+
163
+ declare class CheckersBoardComponent extends EmbedBoardBase {
164
+ showAfkWarning: boolean;
165
+ showLastMove: boolean;
166
+ orientation: 'red' | 'black' | 'auto';
86
167
  get embedUrl(): string;
87
- ngAfterViewInit(): void;
88
168
  }
89
169
 
90
- declare class Connect4BoardComponent implements AfterViewInit {
91
- serverUrl: string;
92
- iframeRef: ElementRef<HTMLIFrameElement>;
93
- svc: BetaGamerService;
170
+ /**
171
+ * @description Connect 4 board embed component.
172
+ */
173
+
174
+ declare class Connect4BoardComponent extends EmbedBoardBase {
175
+ showAfkWarning: boolean;
94
176
  get embedUrl(): string;
95
- ngAfterViewInit(): void;
96
177
  }
178
+
179
+ /**
180
+ * @description Displays the current score for each player in a Connect 4 session.
181
+ * Reads from `gameState().scores` — styled entirely by the consumer via data attributes.
182
+ */
97
183
  declare class Connect4ScoreComponent {
98
- svc: BetaGamerService;
184
+ private svc;
99
185
  get scores(): {
100
186
  id: string;
101
187
  score: unknown;
102
188
  }[];
103
189
  }
104
190
 
105
- declare class TictactoeBoardComponent implements AfterViewInit {
106
- serverUrl: string;
107
- iframeRef: ElementRef<HTMLIFrameElement>;
108
- svc: BetaGamerService;
191
+ /**
192
+ * @description Tic-tac-toe board embed component.
193
+ */
194
+
195
+ declare class TictactoeBoardComponent extends EmbedBoardBase {
196
+ showAfkWarning: boolean;
109
197
  get embedUrl(): string;
110
- ngAfterViewInit(): void;
111
198
  }
112
199
 
200
+ /**
201
+ * @description Subway Runner game embed component.
202
+ */
203
+
113
204
  declare class SubwayRunnerGameComponent implements AfterViewInit {
114
205
  serverUrl: string;
115
206
  iframeRef: ElementRef<HTMLIFrameElement>;
116
- svc: BetaGamerService;
207
+ protected svc: BetaGamerService;
117
208
  get embedUrl(): string;
118
209
  ngAfterViewInit(): void;
119
210
  }
211
+
212
+ /**
213
+ * @description Displays the current score in a Subway Runner session.
214
+ * Reads from `gameState().score`. Style via `data-role="score"`.
215
+ */
120
216
  declare class SubwayRunnerScoreComponent {
121
- svc: BetaGamerService;
217
+ private svc;
122
218
  get score(): any;
123
219
  }
220
+
221
+ /**
222
+ * @description Displays the remaining lives in a Subway Runner session.
223
+ * Reads from `gameState().lives`. Style via `data-role="lives"`.
224
+ */
124
225
  declare class SubwayRunnerLivesComponent {
125
- svc: BetaGamerService;
226
+ private svc;
126
227
  get lives(): any;
127
228
  }
128
229