@thegeem/protocol 0.1.0 → 0.1.1
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/dist/index.d.cts +14 -10
- package/dist/index.d.ts +14 -10
- package/package.json +5 -3
package/dist/index.d.cts
CHANGED
|
@@ -244,6 +244,15 @@ interface YouContext {
|
|
|
244
244
|
/** This player's team index once the game has started; null in the lobby / for the host. */
|
|
245
245
|
teamIndex: number | null;
|
|
246
246
|
}
|
|
247
|
+
/** A pickable category shown in the lobby (one column header on the board). */
|
|
248
|
+
interface CategoryView {
|
|
249
|
+
id: string;
|
|
250
|
+
name: string;
|
|
251
|
+
packId: string;
|
|
252
|
+
packName: string;
|
|
253
|
+
icon: string;
|
|
254
|
+
hasImage: boolean;
|
|
255
|
+
}
|
|
247
256
|
type GameStatus = 'setup' | 'categorySelection' | 'inProgress' | 'completed';
|
|
248
257
|
type GameplayFlow = 'classic' | 'openJudged' | 'noHost' | 'buzzer';
|
|
249
258
|
type BuzzerGameMode = 'off' | 'solo' | 'race' | 'controller';
|
|
@@ -292,7 +301,9 @@ interface GameStateView {
|
|
|
292
301
|
stealPointsActive: boolean;
|
|
293
302
|
trippedTeamIndices: number[];
|
|
294
303
|
/** Shared board: per category id, the level numbers already played. */
|
|
295
|
-
usedLevels:
|
|
304
|
+
usedLevels: {
|
|
305
|
+
[categoryId: string]: number[];
|
|
306
|
+
};
|
|
296
307
|
}
|
|
297
308
|
/** Transient presentation effects the relay emits; clients play them once. */
|
|
298
309
|
type Effect = {
|
|
@@ -369,14 +380,7 @@ type ServerMsg = {
|
|
|
369
380
|
hostId: string;
|
|
370
381
|
hostName: string;
|
|
371
382
|
players: LobbyPlayer[];
|
|
372
|
-
categories:
|
|
373
|
-
id: string;
|
|
374
|
-
name: string;
|
|
375
|
-
packId: string;
|
|
376
|
-
packName: string;
|
|
377
|
-
icon: string;
|
|
378
|
-
hasImage: boolean;
|
|
379
|
-
}[];
|
|
383
|
+
categories: CategoryView[];
|
|
380
384
|
you: YouContext;
|
|
381
385
|
} | {
|
|
382
386
|
t: 'state';
|
|
@@ -393,4 +397,4 @@ type ServerMsg = {
|
|
|
393
397
|
message: string;
|
|
394
398
|
};
|
|
395
399
|
|
|
396
|
-
export { type BuzzerGameMode, ClientMsg, type Effect, GAME_IDS, type GameId, type GameStateView, type GameStatus, type GameplayFlow, type HelpName, LIMITS, type LobbyPlayer, PROTOCOL_VERSION, type QuestionView, ROOM_ALPHABET, type ServerMsg, type SoundName, type TeamView, type YouContext };
|
|
400
|
+
export { type BuzzerGameMode, type CategoryView, ClientMsg, type Effect, GAME_IDS, type GameId, type GameStateView, type GameStatus, type GameplayFlow, type HelpName, LIMITS, type LobbyPlayer, PROTOCOL_VERSION, type QuestionView, ROOM_ALPHABET, type ServerMsg, type SoundName, type TeamView, type YouContext };
|
package/dist/index.d.ts
CHANGED
|
@@ -244,6 +244,15 @@ interface YouContext {
|
|
|
244
244
|
/** This player's team index once the game has started; null in the lobby / for the host. */
|
|
245
245
|
teamIndex: number | null;
|
|
246
246
|
}
|
|
247
|
+
/** A pickable category shown in the lobby (one column header on the board). */
|
|
248
|
+
interface CategoryView {
|
|
249
|
+
id: string;
|
|
250
|
+
name: string;
|
|
251
|
+
packId: string;
|
|
252
|
+
packName: string;
|
|
253
|
+
icon: string;
|
|
254
|
+
hasImage: boolean;
|
|
255
|
+
}
|
|
247
256
|
type GameStatus = 'setup' | 'categorySelection' | 'inProgress' | 'completed';
|
|
248
257
|
type GameplayFlow = 'classic' | 'openJudged' | 'noHost' | 'buzzer';
|
|
249
258
|
type BuzzerGameMode = 'off' | 'solo' | 'race' | 'controller';
|
|
@@ -292,7 +301,9 @@ interface GameStateView {
|
|
|
292
301
|
stealPointsActive: boolean;
|
|
293
302
|
trippedTeamIndices: number[];
|
|
294
303
|
/** Shared board: per category id, the level numbers already played. */
|
|
295
|
-
usedLevels:
|
|
304
|
+
usedLevels: {
|
|
305
|
+
[categoryId: string]: number[];
|
|
306
|
+
};
|
|
296
307
|
}
|
|
297
308
|
/** Transient presentation effects the relay emits; clients play them once. */
|
|
298
309
|
type Effect = {
|
|
@@ -369,14 +380,7 @@ type ServerMsg = {
|
|
|
369
380
|
hostId: string;
|
|
370
381
|
hostName: string;
|
|
371
382
|
players: LobbyPlayer[];
|
|
372
|
-
categories:
|
|
373
|
-
id: string;
|
|
374
|
-
name: string;
|
|
375
|
-
packId: string;
|
|
376
|
-
packName: string;
|
|
377
|
-
icon: string;
|
|
378
|
-
hasImage: boolean;
|
|
379
|
-
}[];
|
|
383
|
+
categories: CategoryView[];
|
|
380
384
|
you: YouContext;
|
|
381
385
|
} | {
|
|
382
386
|
t: 'state';
|
|
@@ -393,4 +397,4 @@ type ServerMsg = {
|
|
|
393
397
|
message: string;
|
|
394
398
|
};
|
|
395
399
|
|
|
396
|
-
export { type BuzzerGameMode, ClientMsg, type Effect, GAME_IDS, type GameId, type GameStateView, type GameStatus, type GameplayFlow, type HelpName, LIMITS, type LobbyPlayer, PROTOCOL_VERSION, type QuestionView, ROOM_ALPHABET, type ServerMsg, type SoundName, type TeamView, type YouContext };
|
|
400
|
+
export { type BuzzerGameMode, type CategoryView, ClientMsg, type Effect, GAME_IDS, type GameId, type GameStateView, type GameStatus, type GameplayFlow, type HelpName, LIMITS, type LobbyPlayer, PROTOCOL_VERSION, type QuestionView, ROOM_ALPHABET, type ServerMsg, type SoundName, type TeamView, type YouContext };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thegeem/protocol",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Geem's wire protocol — shared zod schemas + TypeScript types for talking to the Geem game server over Socket.IO. The source of truth all clients implement against.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"homepage": "https://geem.tv",
|
|
@@ -28,13 +28,15 @@
|
|
|
28
28
|
"scripts": {
|
|
29
29
|
"build": "tsup",
|
|
30
30
|
"typecheck": "tsc --noEmit",
|
|
31
|
-
"release": "node scripts/release.mjs"
|
|
31
|
+
"release": "node scripts/release.mjs",
|
|
32
|
+
"gen:native": "npm run build && node scripts/gen-native.mjs"
|
|
32
33
|
},
|
|
33
34
|
"dependencies": {
|
|
34
35
|
"zod": "^3.23.8"
|
|
35
36
|
},
|
|
36
37
|
"devDependencies": {
|
|
37
|
-
"typescript": "^5.5.4"
|
|
38
|
+
"typescript": "^5.5.4",
|
|
39
|
+
"zod-to-json-schema": "^3.23.5"
|
|
38
40
|
},
|
|
39
41
|
"module": "./dist/index.js",
|
|
40
42
|
"types": "./dist/index.d.ts"
|