import { ChatMessage, getEventsAndClearAcknowledged, sendChat } from "@hellacardgames/lib"; //#region src/game/types/Card.d.ts type Card = NumberCard | DrawTwoCard | ReverseCard | SkipCard | WildCard; type NumberCard = { readonly id: string; readonly type: "number"; readonly color: Color; readonly value: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9; }; type DrawTwoCard = { readonly id: string; readonly type: "drawTwo"; readonly color: Color; }; type ReverseCard = { readonly id: string; readonly type: "reverse"; readonly color: Color; }; type SkipCard = { readonly id: string; readonly type: "skip"; readonly color: Color; }; type WildCard = { readonly id: string; readonly type: "wild"; readonly isDrawFour: boolean; }; type DiscardedCard = NumberCard | DrawTwoCard | ReverseCard | SkipCard | DiscardedWildCard; type DiscardedWildCard = { readonly type: "discardedWild"; readonly card: WildCard; readonly color: Color; }; type Color = (typeof COLORS)[number]; declare const COLORS: readonly ["blue", "green", "red", "yellow"]; //#endregion //#region src/game/constants.d.ts declare const MAX_PLAYERS = 10; //#endregion //#region src/game/types/GameEvent.d.ts type GameEvent = { readonly type: "adminChanged"; readonly id: string; readonly username: string; } | { readonly type: "cardDiscarded"; readonly id: string; readonly card: DiscardedCard; } | { readonly type: "chat"; readonly id: string; readonly message: ChatMessage; } | { readonly type: "directionChanged"; readonly id: string; readonly isReversed: boolean; } | { readonly type: "discardPileReturned"; readonly id: string; } | { readonly type: "expirationUpdated"; readonly id: string; readonly expiresAt: number; } | { readonly type: "gameCompleted"; readonly id: string; } | { readonly type: "gameForfeited"; readonly id: string; } | { readonly type: "gameStarted"; readonly id: string; } | { readonly type: "otherPlayerCardDealt"; readonly id: string; readonly username: string; } | { readonly type: "otherPlayerDrewCard"; readonly id: string; readonly username: string; readonly isPlayable: boolean; } | { readonly type: "otherPlayerDrewFourCards"; readonly id: string; readonly username: string; } | { readonly type: "otherPlayerDrewTwoCards"; readonly id: string; readonly username: string; } | { readonly type: "otherPlayerJoined"; readonly id: string; readonly username: string; } | { readonly type: "otherPlayerLeft"; readonly id: string; readonly username: string; } | { readonly type: "otherPlayerPlayedCard"; readonly id: string; readonly username: string; readonly card: DiscardedCard; } | { readonly type: "otherPlayerReturnedCard"; readonly id: string; readonly username: string; } | { readonly type: "otherPlayerWonGame"; readonly id: string; readonly username: string; readonly score: number; } | { readonly type: "otherPlayerWonRound"; readonly id: string; readonly username: string; readonly score: number; } | { readonly type: "playerCardDealt"; readonly id: string; readonly card: Card; } | { readonly type: "playerDrewCard"; readonly id: string; readonly card: Card; } | { readonly type: "playerDrewFourCards"; readonly id: string; readonly cards: readonly Card[]; } | { readonly type: "playerDrewTwoCards"; readonly id: string; readonly cards: readonly Card[]; } | { readonly type: "playerPlayedCard"; readonly id: string; readonly card: DiscardedCard; } | { readonly type: "playerReturnedCard"; readonly id: string; readonly cardId: string; } | { readonly type: "playerWonGame"; readonly id: string; readonly score: number; } | { readonly type: "playerWonRound"; readonly id: string; readonly score: number; } | { readonly type: "turnChanged"; readonly id: string; readonly currentPlayerUsername: string; }; //#endregion //#region src/game/types/Player.d.ts type Player$1 = { readonly id: string; readonly userId: string; readonly username: string; readonly events: readonly GameEvent[]; readonly hand: readonly Card[]; readonly score: number; }; //#endregion //#region src/game/types/Game.d.ts type Game = CreatedGame | StartedGame | ForfeitedGame | CompletedGame; type CreatedGame = GameProperties & { readonly status: "created"; }; type StartedGame = GameProperties & { readonly status: "started"; }; type ForfeitedGame = GameProperties & { readonly status: "forfeited"; }; type CompletedGame = GameProperties & { readonly status: "completed"; }; type GameProperties = { readonly id: string; readonly createdAt: number; readonly expiresAt: number; readonly status: "created" | "started" | "forfeited" | "completed"; readonly players: readonly Player$1[]; readonly adminId: string; readonly drawPile: readonly Card[]; readonly discardPile: readonly DiscardedCard[]; readonly currentPlayerIndex: number; readonly isReversed: boolean; readonly chatMessages: readonly ChatMessage[]; }; //#endregion //#region src/game/actions/createGame.d.ts declare function createGame(userId: string, username: string): { readonly game: CreatedGame; readonly playerId: string; }; //#endregion //#region src/game/actions/drawCard.d.ts declare function drawCard(game: Game, playerId: string): { readonly success: false; readonly error: "playerNotFound"; readonly game?: never; } | { readonly success: false; readonly error: "invalidStatus"; readonly game?: never; } | { readonly success: false; readonly error: "outOfTurn"; readonly game?: never; } | { readonly success: false; readonly error: "hasPlayableCard"; readonly game?: never; } | { readonly success: true; readonly game: StartedGame; readonly error?: never; }; //#endregion //#region src/game/types/ClientState.d.ts type ClientState = { readonly status: "created" | "started" | "completed" | "forfeited"; readonly gameId: string; readonly playerId: string; readonly player: Player; readonly otherPlayers: readonly OtherPlayer[]; readonly usernames: readonly string[]; readonly adminUsername: string; readonly lastDiscard: DiscardedCard | null; readonly currentPlayerUsername: string; readonly isReversed: boolean; readonly expiresAt: number; readonly chatMessages: readonly ChatMessage[]; }; type Player = { readonly username: string; readonly hand: readonly Card[]; readonly score: number; }; type OtherPlayer = { readonly username: string; readonly numCards: number; readonly score: number; }; //#endregion //#region src/game/actions/getClientStateAndClearEvents.d.ts declare const getClientStateAndClearEvents: (game: Game, playerId: string) => { readonly success: false; readonly error: "playerNotFound"; readonly state?: never; readonly game?: never; } | { readonly success: true; readonly state: ClientState; readonly game: Game; readonly error?: never; }; //#endregion //#region src/game/actions/joinGame.d.ts declare function joinGame(game: Game, userId: string, username: string): { readonly success: false; readonly error: "invalidStatus"; readonly game?: never; readonly playerId?: never; } | { readonly success: false; readonly error: "maxPlayersReached"; readonly game?: never; readonly playerId?: never; } | { readonly success: false; readonly error: "alreadyInGame"; readonly game?: never; readonly playerId?: never; } | { readonly success: true; readonly game: CreatedGame; readonly playerId: string; readonly error?: never; }; //#endregion //#region src/game/actions/leaveGame.d.ts declare function leaveGame(game: Game, playerId: string): { readonly success: false; readonly error: "playerNotFound"; readonly game?: never; } | { readonly success: true; readonly game: Game; readonly error?: never; }; //#endregion //#region src/game/actions/playCard.d.ts declare function playCard(game: Game, playerId: string, cardId: string): { readonly success: false; readonly error: "playerNotFound"; readonly game?: never; } | { readonly success: false; readonly error: "invalidStatus"; readonly game?: never; } | { readonly success: false; readonly error: "outOfTurn"; readonly game?: never; } | { readonly success: false; readonly error: "cardNotFound"; readonly game?: never; } | { readonly success: false; readonly error: "cardIsWild"; readonly game?: never; } | { readonly success: false; readonly error: "cardNotPlayable"; readonly game?: never; } | { readonly success: true; readonly game: StartedGame | CompletedGame; readonly error?: never; }; //#endregion //#region src/game/actions/playWildCard.d.ts declare function playWildCard(game: Game, playerId: string, cardId: string, color: Color): { readonly success: false; readonly error: "playerNotFound"; readonly game?: never; } | { readonly success: false; readonly error: "invalidStatus"; readonly game?: never; } | { readonly success: false; readonly error: "outOfTurn"; readonly game?: never; } | { readonly success: false; readonly error: "cardNotFound"; readonly game?: never; } | { readonly success: false; readonly error: "cardNotWild"; readonly game?: never; } | { readonly success: false; readonly error: "cardNotPlayable"; readonly game?: never; } | { readonly success: true; readonly game: StartedGame | CompletedGame; readonly error?: never; }; //#endregion //#region src/game/actions/startGame.d.ts declare function startGame(game: Game, playerId: string): { readonly success: false; readonly error: "playerNotFound"; readonly game?: never; } | { readonly success: false; readonly error: "playerNotAdmin"; readonly game?: never; } | { readonly success: false; readonly error: "invalidStatus"; readonly game?: never; } | { readonly success: false; readonly error: "minPlayersNotReached"; readonly game?: never; } | { readonly success: true; readonly game: StartedGame; readonly error?: never; }; //#endregion export { Card as _, leaveGame as a, getClientStateAndClearEvents as c, createGame as d, Game as f, COLORS as g, MAX_PLAYERS as h, playCard as i, ClientState as l, ChatMessage as m, sendChat as n, joinGame as o, GameEvent as p, playWildCard as r, getEventsAndClearAcknowledged as s, startGame as t, drawCard as u, Color as v, DiscardedCard as y }; //# sourceMappingURL=index-eCgOhnMT.d.cts.map