lots more kefir tinkering

This commit is contained in:
2025-08-23 17:34:50 -04:00
parent cc53470ddf
commit a2e8887a0b
9 changed files with 99 additions and 53 deletions

View File

@@ -9,11 +9,17 @@ import {
} from "./games/simple";
import { transform } from "./kefir-extension";
export const WebsocketIncomingMessage = t.Union([
export const WsOut = t.Object({
players: t.Optional(t.Array(t.String())),
view: t.Optional(t.Any()),
});
export type TWsOut = typeof WsOut.static;
export const WsIn = t.Union([
t.Object({ proposeGame: t.String() }),
t.Object({ startGame: t.Literal(true) }),
t.Object({ action: t.Any() }),
]);
export type TWsIn = typeof WsIn.static;
type TablePayload<GameState, GameAction> = {
inputs: {