@playcademy/sdk 0.0.1-beta.3 → 0.0.1-beta.30

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,522 @@
1
+ /**
2
+ * @fileoverview Playcademy Messaging System
3
+ *
4
+ * This file implements a unified messaging system for the Playcademy platform that handles
5
+ * communication between different contexts:
6
+ *
7
+ * 1. **Iframe-to-Parent Communication**: When games run inside iframes (production/development),
8
+ * they need to communicate with the parent window using postMessage API
9
+ *
10
+ * 2. **Local Communication**: When games run in the same context (local development),
11
+ * they use CustomEvents for internal messaging
12
+ *
13
+ * The system automatically detects the runtime environment and chooses the appropriate
14
+ * transport method, abstracting this complexity from the developer.
15
+ *
16
+ * **Architecture Overview**:
17
+ * - Games run in iframes for security and isolation
18
+ * - Parent window (Playcademy shell) manages game lifecycle
19
+ * - Messages flow bidirectionally between parent and iframe
20
+ * - Local development mode simulates this architecture without iframes
21
+ */
22
+ import type { GameContextPayload } from './types';
23
+ /**
24
+ * Enumeration of all message types used in the Playcademy messaging system.
25
+ *
26
+ * **Message Flow Patterns**:
27
+ *
28
+ * **Parent → Game (Overworld → Game)**:
29
+ * - INIT: Provides game with authentication token and configuration
30
+ * - TOKEN_REFRESH: Updates game's authentication token before expiry
31
+ * - PAUSE/RESUME: Controls game execution state
32
+ * - FORCE_EXIT: Immediately terminates the game
33
+ * - OVERLAY: Shows/hides UI overlays over the game
34
+ *
35
+ * **Game → Parent (Game → Overworld)**:
36
+ * - READY: Game has loaded and is ready to receive messages
37
+ * - EXIT: Game requests to be closed (user clicked exit, game ended, etc.)
38
+ * - TELEMETRY: Game reports performance metrics (FPS, memory usage, etc.)
39
+ */
40
+ export declare enum MessageEvents {
41
+ /**
42
+ * Initializes the game with authentication context and configuration.
43
+ * Sent immediately after game iframe loads.
44
+ * Payload: { baseUrl: string, token: string, gameId: string }
45
+ */
46
+ INIT = "PLAYCADEMY_INIT",
47
+ /**
48
+ * Updates the game's authentication token before it expires.
49
+ * Sent periodically to maintain valid authentication.
50
+ * Payload: { token: string, exp: number }
51
+ */
52
+ TOKEN_REFRESH = "PLAYCADEMY_TOKEN_REFRESH",
53
+ /**
54
+ * Pauses game execution (e.g., when user switches tabs).
55
+ * Game should pause timers, animations, and user input.
56
+ * Payload: void
57
+ */
58
+ PAUSE = "PLAYCADEMY_PAUSE",
59
+ /**
60
+ * Resumes game execution after being paused.
61
+ * Game should restore timers, animations, and user input.
62
+ * Payload: void
63
+ */
64
+ RESUME = "PLAYCADEMY_RESUME",
65
+ /**
66
+ * Forces immediate game termination (emergency exit).
67
+ * Game should clean up resources and exit immediately.
68
+ * Payload: void
69
+ */
70
+ FORCE_EXIT = "PLAYCADEMY_FORCE_EXIT",
71
+ /**
72
+ * Shows or hides UI overlays over the game.
73
+ * Game may need to pause or adjust rendering accordingly.
74
+ * Payload: boolean (true = show overlay, false = hide overlay)
75
+ */
76
+ OVERLAY = "PLAYCADEMY_OVERLAY",
77
+ /**
78
+ * Game has finished loading and is ready to receive messages.
79
+ * Sent once after game initialization is complete.
80
+ * Payload: void
81
+ */
82
+ READY = "PLAYCADEMY_READY",
83
+ /**
84
+ * Game requests to be closed/exited.
85
+ * Sent when user clicks exit button or game naturally ends.
86
+ * Payload: void
87
+ */
88
+ EXIT = "PLAYCADEMY_EXIT",
89
+ /**
90
+ * Game reports performance telemetry data.
91
+ * Sent periodically for monitoring and analytics.
92
+ * Payload: { fps: number, mem: number }
93
+ */
94
+ TELEMETRY = "PLAYCADEMY_TELEMETRY",
95
+ /**
96
+ * Game reports key events to parent.
97
+ * Sent when certain keys are pressed within the game iframe.
98
+ * Payload: { key: string, code?: string, type: 'keydown' | 'keyup' }
99
+ */
100
+ KEY_EVENT = "PLAYCADEMY_KEY_EVENT"
101
+ }
102
+ /**
103
+ * Type definition for message handler functions.
104
+ * These functions are called when a specific message type is received.
105
+ *
106
+ * @template T - The type of payload data the handler expects
107
+ * @param payload - The data sent with the message
108
+ */
109
+ type MessageHandler<T = unknown> = (payload: T) => void;
110
+ /**
111
+ * Type mapping that defines the payload structure for each message type.
112
+ * This ensures type safety when sending and receiving messages.
113
+ *
114
+ * **Usage Examples**:
115
+ * ```typescript
116
+ * // Type-safe message sending
117
+ * messaging.send(MessageEvents.INIT, { baseUrl: '/api', token: 'abc', gameId: '123' })
118
+ *
119
+ * // Type-safe message handling
120
+ * messaging.listen(MessageEvents.TOKEN_REFRESH, ({ token, exp }) => {
121
+ * console.log(`New token expires at: ${new Date(exp)}`)
122
+ * })
123
+ * ```
124
+ */
125
+ export type MessageEventMap = {
126
+ /** Game initialization context with API endpoint, auth token, and game ID */
127
+ [MessageEvents.INIT]: GameContextPayload;
128
+ /** Token refresh data with new token and expiration timestamp */
129
+ [MessageEvents.TOKEN_REFRESH]: {
130
+ token: string;
131
+ exp: number;
132
+ };
133
+ /** Pause message has no payload data */
134
+ [MessageEvents.PAUSE]: void;
135
+ /** Resume message has no payload data */
136
+ [MessageEvents.RESUME]: void;
137
+ /** Force exit message has no payload data */
138
+ [MessageEvents.FORCE_EXIT]: void;
139
+ /** Overlay visibility state (true = show, false = hide) */
140
+ [MessageEvents.OVERLAY]: boolean;
141
+ /** Ready message has no payload data */
142
+ [MessageEvents.READY]: void;
143
+ /** Exit message has no payload data */
144
+ [MessageEvents.EXIT]: void;
145
+ /** Performance telemetry data */
146
+ [MessageEvents.TELEMETRY]: {
147
+ fps: number;
148
+ mem: number;
149
+ };
150
+ /** Key event data */
151
+ [MessageEvents.KEY_EVENT]: {
152
+ key: string;
153
+ code?: string;
154
+ type: 'keydown' | 'keyup';
155
+ };
156
+ };
157
+ /**
158
+ * **PlaycademyMessaging Class**
159
+ *
160
+ * This is the core messaging system that handles all communication in the Playcademy platform.
161
+ * It automatically detects the runtime environment and chooses the appropriate transport method.
162
+ *
163
+ * **Key Features**:
164
+ * 1. **Automatic Transport Selection**: Detects iframe vs local context and uses appropriate method
165
+ * 2. **Type Safety**: Full TypeScript support with payload type checking
166
+ * 3. **Bidirectional Communication**: Handles both parent→game and game→parent messages
167
+ * 4. **Event Cleanup**: Proper listener management to prevent memory leaks
168
+ *
169
+ * **Transport Methods**:
170
+ * - **postMessage**: Used for iframe-to-parent communication (production/development)
171
+ * - **CustomEvent**: Used for local same-context communication (local development)
172
+ *
173
+ * **Runtime Detection Logic**:
174
+ * - If `window.self !== window.top`: We're in an iframe, use postMessage
175
+ * - If `window.self === window.top`: We're in the same context, use CustomEvent
176
+ *
177
+ * **Example Usage**:
178
+ * ```typescript
179
+ * // Send a message (automatically chooses transport)
180
+ * messaging.send(MessageEvents.READY, undefined)
181
+ *
182
+ * // Listen for messages (handles both transports)
183
+ * messaging.listen(MessageEvents.INIT, (payload) => {
184
+ * console.log('Game initialized with:', payload)
185
+ * })
186
+ *
187
+ * // Clean up listeners
188
+ * messaging.unlisten(MessageEvents.INIT, handler)
189
+ * ```
190
+ */
191
+ declare class PlaycademyMessaging {
192
+ /**
193
+ * Internal storage for message listeners.
194
+ *
195
+ * **Structure Explanation**:
196
+ * - Outer Map: MessageEvents → Map of handlers for that event type
197
+ * - Inner Map: MessageHandler → Object containing both listener types
198
+ * - Object: { postMessage: EventListener, customEvent: EventListener }
199
+ *
200
+ * **Why Two Listeners Per Handler?**:
201
+ * Since we don't know at registration time which transport will be used,
202
+ * we register both a postMessage listener and a CustomEvent listener.
203
+ * The appropriate one will be triggered based on the runtime context.
204
+ */
205
+ private listeners;
206
+ /**
207
+ * **Send Message Method**
208
+ *
209
+ * Sends a message using the appropriate transport method based on the runtime context.
210
+ * This is the main public API for sending messages in the Playcademy system.
211
+ *
212
+ * **How It Works**:
213
+ * 1. Analyzes the message type and current runtime context
214
+ * 2. Determines if we're in an iframe and if this message should use postMessage
215
+ * 3. Routes to the appropriate transport method (postMessage or CustomEvent)
216
+ *
217
+ * **Transport Selection Logic**:
218
+ * - **postMessage**: Used when game is in iframe and sending to parent, OR when target window is specified
219
+ * - **CustomEvent**: Used for local/same-context communication
220
+ *
221
+ * **Type Safety**:
222
+ * The generic type parameter `K` ensures that the payload type matches
223
+ * the expected type for the given message event.
224
+ *
225
+ * @template K - The message event type (ensures type safety)
226
+ * @param type - The message event type to send
227
+ * @param payload - The data to send with the message (type-checked)
228
+ * @param options - Optional configuration for message sending
229
+ *
230
+ * @example
231
+ * ```typescript
232
+ * // Send game ready signal (no payload)
233
+ * messaging.send(MessageEvents.READY, undefined)
234
+ *
235
+ * // Send telemetry data (typed payload)
236
+ * messaging.send(MessageEvents.TELEMETRY, { fps: 60, mem: 128 })
237
+ *
238
+ * // Send to specific iframe window (parent to iframe communication)
239
+ * messaging.send(MessageEvents.INIT, { baseUrl, token, gameId }, {
240
+ * target: iframe.contentWindow,
241
+ * origin: '*'
242
+ * })
243
+ *
244
+ * // TypeScript will error if payload type is wrong
245
+ * messaging.send(MessageEvents.INIT, "wrong type") // ❌ Error
246
+ * ```
247
+ */
248
+ send<K extends MessageEvents>(type: K, payload: MessageEventMap[K], options?: {
249
+ target?: Window;
250
+ origin?: string;
251
+ }): void;
252
+ /**
253
+ * **Listen for Messages Method**
254
+ *
255
+ * Registers a message listener that will be called when the specified message type is received.
256
+ * This method automatically handles both postMessage and CustomEvent sources.
257
+ *
258
+ * **Why Register Two Listeners?**:
259
+ * Since we don't know at registration time which transport method will be used to send
260
+ * messages, we register listeners for both possible sources:
261
+ * 1. **postMessage listener**: Handles messages from iframe-to-parent communication
262
+ * 2. **CustomEvent listener**: Handles messages from local same-context communication
263
+ *
264
+ * **Message Processing**:
265
+ * - **postMessage**: Extracts data from `event.data.payload` or `event.data`
266
+ * - **CustomEvent**: Extracts data from `event.detail`
267
+ *
268
+ * **Type Safety**:
269
+ * The handler function receives the correctly typed payload based on the message type.
270
+ *
271
+ * @template K - The message event type (ensures type safety)
272
+ * @param type - The message event type to listen for
273
+ * @param handler - Function to call when the message is received
274
+ *
275
+ * @example
276
+ * ```typescript
277
+ * // Listen for game initialization
278
+ * messaging.listen(MessageEvents.INIT, (payload) => {
279
+ * // payload is automatically typed as GameContextPayload
280
+ * console.log(`Game ${payload.gameId} initialized`)
281
+ * console.log(`API base URL: ${payload.baseUrl}`)
282
+ * })
283
+ *
284
+ * // Listen for token refresh
285
+ * messaging.listen(MessageEvents.TOKEN_REFRESH, ({ token, exp }) => {
286
+ * // payload is automatically typed as { token: string; exp: number }
287
+ * updateAuthToken(token)
288
+ * scheduleTokenRefresh(exp)
289
+ * })
290
+ * ```
291
+ */
292
+ listen<K extends MessageEvents>(type: K, handler: MessageHandler<MessageEventMap[K]>): void;
293
+ /**
294
+ * **Remove Message Listener Method**
295
+ *
296
+ * Removes a previously registered message listener to prevent memory leaks and unwanted callbacks.
297
+ * This method cleans up both the postMessage and CustomEvent listeners that were registered.
298
+ *
299
+ * **Why Clean Up Both Listeners?**:
300
+ * When we registered the listener with `listen()`, we created two browser event listeners:
301
+ * 1. A 'message' event listener for postMessage communication
302
+ * 2. A custom event listener for local CustomEvent communication
303
+ *
304
+ * Both must be removed to prevent memory leaks and ensure the handler is completely unregistered.
305
+ *
306
+ * **Memory Management**:
307
+ * - Removes both event listeners from the browser
308
+ * - Cleans up internal tracking maps
309
+ * - If no more handlers exist for a message type, removes the entire type entry
310
+ *
311
+ * **Safe to Call Multiple Times**:
312
+ * This method is idempotent - calling it multiple times with the same handler is safe.
313
+ *
314
+ * @template K - The message event type (ensures type safety)
315
+ * @param type - The message event type to stop listening for
316
+ * @param handler - The exact handler function that was passed to listen()
317
+ *
318
+ * @example
319
+ * ```typescript
320
+ * // Register a handler
321
+ * const handleInit = (payload) => console.log('Game initialized')
322
+ * messaging.listen(MessageEvents.INIT, handleInit)
323
+ *
324
+ * // Later, remove the handler
325
+ * messaging.unlisten(MessageEvents.INIT, handleInit)
326
+ *
327
+ * // Safe to call multiple times
328
+ * messaging.unlisten(MessageEvents.INIT, handleInit) // No error
329
+ * ```
330
+ */
331
+ unlisten<K extends MessageEvents>(type: K, handler: MessageHandler<MessageEventMap[K]>): void;
332
+ /**
333
+ * **Get Messaging Context Method**
334
+ *
335
+ * Analyzes the current runtime environment and message type to determine the appropriate
336
+ * transport method and configuration for sending messages.
337
+ *
338
+ * **Runtime Environment Detection**:
339
+ * The method detects whether the code is running in an iframe by comparing:
340
+ * - `window.self`: Reference to the current window
341
+ * - `window.top`: Reference to the topmost window in the hierarchy
342
+ *
343
+ * If they're different, we're in an iframe. If they're the same, we're in the top-level window.
344
+ *
345
+ * **Message Direction Analysis**:
346
+ * Different message types flow in different directions:
347
+ * - **Game → Parent**: READY, EXIT, TELEMETRY (use postMessage when in iframe)
348
+ * - **Parent → Game**: INIT, TOKEN_REFRESH, PAUSE, etc. (use CustomEvent in local dev, or postMessage with target)
349
+ *
350
+ * **Cross-Context Communication**:
351
+ * The messaging system supports cross-context targeting through the optional `target` parameter.
352
+ * When a target window is specified, postMessage is used regardless of the current context.
353
+ * This enables parent-to-iframe communication through the unified messaging API.
354
+ *
355
+ * **Transport Selection Logic**:
356
+ * - **postMessage**: Used when game is in iframe AND sending to parent, OR when target window is specified
357
+ * - **CustomEvent**: Used for all other cases (local development, same-context communication)
358
+ *
359
+ * **Security Considerations**:
360
+ * The origin is currently set to '*' for development convenience, but should be
361
+ * configurable for production security.
362
+ *
363
+ * @param eventType - The message event type being sent
364
+ * @returns Configuration object with transport method and target information
365
+ *
366
+ * @example
367
+ * ```typescript
368
+ * // In iframe sending READY to parent
369
+ * const context = getMessagingContext(MessageEvents.READY)
370
+ * // Returns: { shouldUsePostMessage: true, target: window.parent, origin: '*' }
371
+ *
372
+ * // In same context sending INIT
373
+ * const context = getMessagingContext(MessageEvents.INIT)
374
+ * // Returns: { shouldUsePostMessage: false, target: undefined, origin: '*' }
375
+ * ```
376
+ */
377
+ private getMessagingContext;
378
+ /**
379
+ * **Send Via PostMessage Method**
380
+ *
381
+ * Sends a message using the browser's postMessage API for iframe-to-parent communication.
382
+ * This method is used when the game is running in an iframe and needs to communicate
383
+ * with the parent window (the Playcademy shell).
384
+ *
385
+ * **PostMessage Protocol**:
386
+ * The postMessage API is the standard way for iframes to communicate with their parent.
387
+ * It's secure, cross-origin capable, and designed specifically for this use case.
388
+ *
389
+ * **Message Structure**:
390
+ * The method creates a message object with the following structure:
391
+ * - `type`: The message event type (e.g., 'PLAYCADEMY_READY')
392
+ * - `payload`: The message data (if any)
393
+ *
394
+ * **Payload Handling**:
395
+ * - **All payloads**: Wrapped in a `payload` property for consistency (e.g., { type, payload: data })
396
+ * - **Undefined payloads**: Only the type is sent (e.g., { type })
397
+ *
398
+ * **Security**:
399
+ * The origin parameter controls which domains can receive the message.
400
+ * Currently set to '*' for development, but should be restricted in production.
401
+ *
402
+ * @template K - The message event type (ensures type safety)
403
+ * @param type - The message event type to send
404
+ * @param payload - The data to send with the message
405
+ * @param target - The target window (defaults to parent window)
406
+ * @param origin - The allowed origin for the message (defaults to '*')
407
+ *
408
+ * @example
409
+ * ```typescript
410
+ * // Send ready signal (no payload)
411
+ * sendViaPostMessage(MessageEvents.READY, undefined)
412
+ * // Sends: { type: 'PLAYCADEMY_READY' }
413
+ *
414
+ * // Send telemetry data (object payload)
415
+ * sendViaPostMessage(MessageEvents.TELEMETRY, { fps: 60, mem: 128 })
416
+ * // Sends: { type: 'PLAYCADEMY_TELEMETRY', payload: { fps: 60, mem: 128 } }
417
+ *
418
+ * // Send overlay state (primitive payload)
419
+ * sendViaPostMessage(MessageEvents.OVERLAY, true)
420
+ * // Sends: { type: 'PLAYCADEMY_OVERLAY', payload: true }
421
+ * ```
422
+ */
423
+ private sendViaPostMessage;
424
+ /**
425
+ * **Send Via CustomEvent Method**
426
+ *
427
+ * Sends a message using the browser's CustomEvent API for local same-context communication.
428
+ * This method is used when both the sender and receiver are in the same window context,
429
+ * typically during local development or when the parent needs to send messages to the game.
430
+ *
431
+ * **CustomEvent Protocol**:
432
+ * CustomEvent is a browser API for creating and dispatching custom events within the same
433
+ * window context. It's simpler than postMessage but only works within the same origin/context.
434
+ *
435
+ * **Event Structure**:
436
+ * - **type**: The event name (e.g., 'PLAYCADEMY_INIT')
437
+ * - **detail**: The payload data attached to the event
438
+ *
439
+ * **When This Is Used**:
440
+ * - Local development when game and shell run in the same context
441
+ * - Parent-to-game communication (INIT, TOKEN_REFRESH, PAUSE, etc.)
442
+ * - Any scenario where postMessage isn't needed
443
+ *
444
+ * **Event Bubbling**:
445
+ * CustomEvents are dispatched on the window object and can be listened to by any
446
+ * code in the same context using `addEventListener(type, handler)`.
447
+ *
448
+ * @template K - The message event type (ensures type safety)
449
+ * @param type - The message event type to send (becomes the event name)
450
+ * @param payload - The data to send with the message (stored in event.detail)
451
+ *
452
+ * @example
453
+ * ```typescript
454
+ * // Send initialization data
455
+ * sendViaCustomEvent(MessageEvents.INIT, {
456
+ * baseUrl: '/api',
457
+ * token: 'abc123',
458
+ * gameId: 'game-456'
459
+ * })
460
+ * // Creates: CustomEvent('PLAYCADEMY_INIT', { detail: { baseUrl, token, gameId } })
461
+ *
462
+ * // Send pause signal
463
+ * sendViaCustomEvent(MessageEvents.PAUSE, undefined)
464
+ * // Creates: CustomEvent('PLAYCADEMY_PAUSE', { detail: undefined })
465
+ *
466
+ * // Listeners can access the data via event.detail:
467
+ * window.addEventListener('PLAYCADEMY_INIT', (event) => {
468
+ * console.log(event.detail.gameId) // 'game-456'
469
+ * })
470
+ * ```
471
+ */
472
+ private sendViaCustomEvent;
473
+ }
474
+ /**
475
+ * **Playcademy Messaging Singleton**
476
+ *
477
+ * This is the main messaging instance used throughout the Playcademy platform.
478
+ * It's exported as a singleton to ensure consistent communication across all parts
479
+ * of the application.
480
+ *
481
+ * **Why a Singleton?**:
482
+ * - Ensures all parts of the app use the same messaging instance
483
+ * - Prevents conflicts between multiple messaging systems
484
+ * - Simplifies the API - no need to pass instances around
485
+ * - Maintains consistent event listener management
486
+ *
487
+ * **Usage in Different Contexts**:
488
+ *
489
+ * **In Games**:
490
+ * ```typescript
491
+ * import { messaging, MessageEvents } from '@playcademy/sdk'
492
+ *
493
+ * // Tell parent we're ready
494
+ * messaging.send(MessageEvents.READY, undefined)
495
+ *
496
+ * // Listen for pause/resume
497
+ * messaging.listen(MessageEvents.PAUSE, () => game.pause())
498
+ * messaging.listen(MessageEvents.RESUME, () => game.resume())
499
+ * ```
500
+ *
501
+ * **In Parent Shell**:
502
+ * ```typescript
503
+ * import { messaging, MessageEvents } from '@playcademy/sdk'
504
+ *
505
+ * // Send initialization data to game
506
+ * messaging.send(MessageEvents.INIT, { baseUrl, token, gameId })
507
+ *
508
+ * // Listen for game events
509
+ * messaging.listen(MessageEvents.EXIT, () => closeGame())
510
+ * messaging.listen(MessageEvents.READY, () => showGame())
511
+ * ```
512
+ *
513
+ * **Automatic Transport Selection**:
514
+ * The messaging system automatically chooses the right transport method:
515
+ * - Uses postMessage when game is in iframe sending to parent
516
+ * - Uses CustomEvent for local development and parent-to-game communication
517
+ *
518
+ * **Type Safety**:
519
+ * All message sending and receiving is fully type-safe with TypeScript.
520
+ */
521
+ export declare const messaging: PlaycademyMessaging;
522
+ export {};
package/dist/types.d.ts CHANGED
@@ -1,4 +1,6 @@
1
- import type { User, InventoryItemWithReward, Game, DeveloperKey, DeveloperStatusResponse, MapElement, Reward, InsertReward, ManifestV1, UpdateReward } from '@playcademy/data/schemas';
1
+ export type * from '@playcademy/data/types';
2
+ export { CURRENCIES, BADGES } from '@playcademy/data/constants';
3
+ export type { PlaycademyClient } from './core/client';
2
4
  export interface ClientConfig {
3
5
  baseUrl: string;
4
6
  token?: string;
@@ -9,24 +11,30 @@ export interface ClientEvents {
9
11
  token: string | null;
10
12
  };
11
13
  inventoryChange: {
12
- rewardId: string;
14
+ itemId: string;
13
15
  delta: number;
14
16
  newTotal: number;
15
17
  };
18
+ levelUp: {
19
+ oldLevel: number;
20
+ newLevel: number;
21
+ creditsAwarded: number;
22
+ };
23
+ xpGained: {
24
+ amount: number;
25
+ totalXP: number;
26
+ leveledUp: boolean;
27
+ };
16
28
  }
17
29
  export type GameContextPayload = {
18
30
  token: string;
19
31
  baseUrl: string;
20
32
  gameId: string;
33
+ forwardKeys?: string[];
21
34
  };
22
35
  export type EventListeners = {
23
36
  [E in keyof ClientEvents]?: Array<(payload: ClientEvents[E]) => void>;
24
37
  };
25
- export type GameWithManifest = Game & {
26
- manifest: ManifestV1;
27
- };
28
- export type DeveloperStatusValue = DeveloperStatusResponse['status'];
29
- export type GameState = Record<string, unknown>;
30
38
  export type LoginResponse = {
31
39
  token: string;
32
40
  };
@@ -40,4 +48,3 @@ export type StartSessionResponse = {
40
48
  export type InventoryMutationResponse = {
41
49
  newTotal: number;
42
50
  };
43
- export type { User, InventoryItemWithReward, Game, ManifestV1, DeveloperKey, DeveloperStatusResponse, MapElement, Reward, InsertReward, UpdateReward, };