@hellacardgames/speed 0.5.1 → 0.5.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/dist/client/index.cjs.map +1 -1
- package/dist/client/index.d.cts +2 -3
- package/dist/client/index.d.cts.map +1 -1
- package/dist/client/index.d.mts +2 -3
- package/dist/client/index.d.mts.map +1 -1
- package/dist/client/index.mjs.map +1 -1
- package/dist/index-BilCO_4a.d.cts +216 -0
- package/dist/index-BilCO_4a.d.cts.map +1 -0
- package/dist/index-BilCO_4a.d.mts +216 -0
- package/dist/index-BilCO_4a.d.mts.map +1 -0
- package/dist/{startGame-5InkAgEp.d.cts → index-DSPZZlhq.d.cts} +39 -4
- package/dist/index-DSPZZlhq.d.cts.map +1 -0
- package/dist/{startGame-ayp8a-Cl.d.mts → index-S-oO1z9X.d.mts} +39 -4
- package/dist/index-S-oO1z9X.d.mts.map +1 -0
- package/dist/manager/index.cjs +12 -32
- package/dist/manager/index.d.cts +2 -109
- package/dist/manager/index.d.mts +2 -109
- package/dist/manager/index.mjs +1 -21
- package/dist/{startGame-BC9XfFzG.mjs → manager-CPmezdJa.mjs} +21 -2
- package/dist/manager-CPmezdJa.mjs.map +1 -0
- package/dist/{startGame-Bhk__XWk.cjs → manager-DErQ_XUq.cjs} +20 -19
- package/dist/manager-DErQ_XUq.cjs.map +1 -0
- package/dist/server/index.cjs +12 -12
- package/dist/server/index.cjs.map +1 -1
- package/dist/server/index.d.cts +3 -40
- package/dist/server/index.d.mts +3 -40
- package/dist/server/index.mjs +1 -1
- package/dist/server/index.mjs.map +1 -1
- package/package.json +2 -2
- package/dist/GameEvent-DDQ4jXxt.d.cts +0 -111
- package/dist/GameEvent-DDQ4jXxt.d.cts.map +0 -1
- package/dist/GameEvent-DDQ4jXxt.d.mts +0 -111
- package/dist/GameEvent-DDQ4jXxt.d.mts.map +0 -1
- package/dist/manager/index.cjs.map +0 -1
- package/dist/manager/index.d.cts.map +0 -1
- package/dist/manager/index.d.mts.map +0 -1
- package/dist/manager/index.mjs.map +0 -1
- package/dist/server/index.d.cts.map +0 -1
- package/dist/server/index.d.mts.map +0 -1
- package/dist/startGame-5InkAgEp.d.cts.map +0 -1
- package/dist/startGame-BC9XfFzG.mjs.map +0 -1
- package/dist/startGame-Bhk__XWk.cjs.map +0 -1
- package/dist/startGame-ayp8a-Cl.d.mts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":[],"sources":["../../src/client/Client.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"index.cjs","names":[],"sources":["../../src/client/Client.ts"],"sourcesContent":["import type {\n CreateGameResult,\n DrawCardResult,\n GetClientStateAndClearEventsResult,\n GetEventsAndClearAcknowledgedResult,\n GetJoinableGamesResult,\n JoinGameResult,\n LeaveGameResult,\n PlayCardResult,\n ReportNoPlayableCardsResult,\n SendChatResult,\n StartGameResult,\n} from \"../server/index.js\";\n\nexport class Client {\n private readonly baseUrl: string;\n\n constructor(baseUrl: string) {\n this.baseUrl = baseUrl;\n }\n\n async createGame(accessToken: string): Promise<CreateGameResult> {\n const response = await fetch(`${this.baseUrl}/createGame`, {\n method: \"POST\",\n headers: {\n Authorization: `Bearer ${accessToken}`,\n },\n });\n const result = await response.json();\n return result;\n }\n\n async drawCard(gameId: string, playerId: string): Promise<DrawCardResult> {\n const response = await fetch(`${this.baseUrl}/drawCard`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({ gameId, playerId }),\n });\n const result = await response.json();\n return result;\n }\n\n async getClientStateAndClearEvents(\n gameId: string,\n playerId: string,\n ): Promise<GetClientStateAndClearEventsResult> {\n const response = await fetch(\n `${this.baseUrl}/getClientStateAndClearEvents`,\n {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({ gameId, playerId }),\n },\n );\n const result = await response.json();\n return result;\n }\n\n async getEventsAndClearAcknowledged(\n gameId: string,\n playerId: string,\n lastReadId: string | null,\n ): Promise<GetEventsAndClearAcknowledgedResult> {\n const response = await fetch(\n `${this.baseUrl}/getEventsAndClearAcknowledged`,\n {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({ gameId, playerId, lastReadId }),\n },\n );\n const result = await response.json();\n return result;\n }\n\n async getJoinableGames(): Promise<GetJoinableGamesResult> {\n const response = await fetch(`${this.baseUrl}/getJoinableGames`, {\n method: \"POST\",\n });\n const result = await response.json();\n return result;\n }\n\n async joinGame(gameId: string, accessToken: string): Promise<JoinGameResult> {\n const response = await fetch(`${this.baseUrl}/joinGame`, {\n method: \"POST\",\n headers: {\n Authorization: `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({ gameId }),\n });\n const result = await response.json();\n return result;\n }\n\n async leaveGame(gameId: string, playerId: string): Promise<LeaveGameResult> {\n const response = await fetch(`${this.baseUrl}/leaveGame`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({ gameId, playerId }),\n });\n const result = await response.json();\n return result;\n }\n\n async playCard(\n gameId: string,\n playerId: string,\n cardId: string,\n isForOtherPlayerPile: boolean,\n ): Promise<PlayCardResult> {\n const response = await fetch(`${this.baseUrl}/playCard`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({ gameId, playerId, cardId, isForOtherPlayerPile }),\n });\n const result = await response.json();\n return result;\n }\n\n async reportNoPlayableCards(\n gameId: string,\n playerId: string,\n ): Promise<ReportNoPlayableCardsResult> {\n const response = await fetch(`${this.baseUrl}/reportNoPlayableCards`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({ gameId, playerId }),\n });\n const result = await response.json();\n return result;\n }\n\n async sendChat(\n gameId: string,\n playerId: string,\n text: string,\n ): Promise<SendChatResult> {\n const response = await fetch(`${this.baseUrl}/sendChat`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({ gameId, playerId, text }),\n });\n const result = await response.json();\n return result;\n }\n\n async startGame(gameId: string, playerId: string): Promise<StartGameResult> {\n const response = await fetch(`${this.baseUrl}/startGame`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({ gameId, playerId }),\n });\n const result = await response.json();\n return result;\n }\n}\n"],"mappings":";;AAcA,IAAa,SAAb,MAAoB;CAClB;CAEA,YAAY,SAAiB;EAC3B,KAAK,UAAU;CACjB;CAEA,MAAM,WAAW,aAAgD;EAQ/D,OAAO,OADc,MANE,MAAM,GAAG,KAAK,QAAQ,cAAc;GACzD,QAAQ;GACR,SAAS,EACP,eAAe,UAAU,cAC3B;EACF,CAAC,EAAA,CAC6B,KAAK;CAErC;CAEA,MAAM,SAAS,QAAgB,UAA2C;EASxE,OAAO,OADc,MAPE,MAAM,GAAG,KAAK,QAAQ,YAAY;GACvD,QAAQ;GACR,SAAS,EACP,gBAAgB,mBAClB;GACA,MAAM,KAAK,UAAU;IAAE;IAAQ;GAAS,CAAC;EAC3C,CAAC,EAAA,CAC6B,KAAK;CAErC;CAEA,MAAM,6BACJ,QACA,UAC6C;EAY7C,OAAO,OADc,MAVE,MACrB,GAAG,KAAK,QAAQ,gCAChB;GACE,QAAQ;GACR,SAAS,EACP,gBAAgB,mBAClB;GACA,MAAM,KAAK,UAAU;IAAE;IAAQ;GAAS,CAAC;EAC3C,CACF,EAAA,CAC8B,KAAK;CAErC;CAEA,MAAM,8BACJ,QACA,UACA,YAC8C;EAY9C,OAAO,OADc,MAVE,MACrB,GAAG,KAAK,QAAQ,iCAChB;GACE,QAAQ;GACR,SAAS,EACP,gBAAgB,mBAClB;GACA,MAAM,KAAK,UAAU;IAAE;IAAQ;IAAU;GAAW,CAAC;EACvD,CACF,EAAA,CAC8B,KAAK;CAErC;CAEA,MAAM,mBAAoD;EAKxD,OAAO,OADc,MAHE,MAAM,GAAG,KAAK,QAAQ,oBAAoB,EAC/D,QAAQ,OACV,CAAC,EAAA,CAC6B,KAAK;CAErC;CAEA,MAAM,SAAS,QAAgB,aAA8C;EAU3E,OAAO,OADc,MARE,MAAM,GAAG,KAAK,QAAQ,YAAY;GACvD,QAAQ;GACR,SAAS;IACP,eAAe,UAAU;IACzB,gBAAgB;GAClB;GACA,MAAM,KAAK,UAAU,EAAE,OAAO,CAAC;EACjC,CAAC,EAAA,CAC6B,KAAK;CAErC;CAEA,MAAM,UAAU,QAAgB,UAA4C;EAS1E,OAAO,OADc,MAPE,MAAM,GAAG,KAAK,QAAQ,aAAa;GACxD,QAAQ;GACR,SAAS,EACP,gBAAgB,mBAClB;GACA,MAAM,KAAK,UAAU;IAAE;IAAQ;GAAS,CAAC;EAC3C,CAAC,EAAA,CAC6B,KAAK;CAErC;CAEA,MAAM,SACJ,QACA,UACA,QACA,sBACyB;EASzB,OAAO,OADc,MAPE,MAAM,GAAG,KAAK,QAAQ,YAAY;GACvD,QAAQ;GACR,SAAS,EACP,gBAAgB,mBAClB;GACA,MAAM,KAAK,UAAU;IAAE;IAAQ;IAAU;IAAQ;GAAqB,CAAC;EACzE,CAAC,EAAA,CAC6B,KAAK;CAErC;CAEA,MAAM,sBACJ,QACA,UACsC;EAStC,OAAO,OADc,MAPE,MAAM,GAAG,KAAK,QAAQ,yBAAyB;GACpE,QAAQ;GACR,SAAS,EACP,gBAAgB,mBAClB;GACA,MAAM,KAAK,UAAU;IAAE;IAAQ;GAAS,CAAC;EAC3C,CAAC,EAAA,CAC6B,KAAK;CAErC;CAEA,MAAM,SACJ,QACA,UACA,MACyB;EASzB,OAAO,OADc,MAPE,MAAM,GAAG,KAAK,QAAQ,YAAY;GACvD,QAAQ;GACR,SAAS,EACP,gBAAgB,mBAClB;GACA,MAAM,KAAK,UAAU;IAAE;IAAQ;IAAU;GAAK,CAAC;EACjD,CAAC,EAAA,CAC6B,KAAK;CAErC;CAEA,MAAM,UAAU,QAAgB,UAA4C;EAS1E,OAAO,OADc,MAPE,MAAM,GAAG,KAAK,QAAQ,aAAa;GACxD,QAAQ;GACR,SAAS,EACP,gBAAgB,mBAClB;GACA,MAAM,KAAK,UAAU;IAAE;IAAQ;GAAS,CAAC;EAC3C,CAAC,EAAA,CAC6B,KAAK;CAErC;AACF"}
|
package/dist/client/index.d.cts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { a as PlayCardResult, c as GetJoinableGamesResult, d as DrawCardResult, f as CreateGameResult, i as ReportNoPlayableCardsResult, l as GetEventsAndClearAcknowledgedResult, n as StartGameResult, o as LeaveGameResult, r as SendChatResult, s as JoinGameResult, u as GetClientStateAndClearEventsResult } from "../index-DSPZZlhq.cjs";
|
|
2
|
+
import { d as ClientState, f as ChatMessage, l as GameEvent, p as Card } from "../index-BilCO_4a.cjs";
|
|
4
3
|
//#region src/client/Client.d.ts
|
|
5
4
|
declare class Client {
|
|
6
5
|
private readonly baseUrl;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../../src/client/Client.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../../src/client/Client.ts"],"mappings":";;;cAca;mBACM;EAEL,YAAA;EAIN,WAAW,sBAAsB,QAAQ;EAWzC,SAAS,gBAAgB,mBAAmB,QAAQ;EAYpD,6BACJ,gBACA,mBACC,QAAQ;EAeL,8BACJ,gBACA,kBACA,4BACC,QAAQ;EAeL,oBAAoB,QAAQ;EAQ5B,SAAS,gBAAgB,sBAAsB,QAAQ;EAavD,UAAU,gBAAgB,mBAAmB,QAAQ;EAYrD,SACJ,gBACA,kBACA,gBACA,gCACC,QAAQ;EAYL,sBACJ,gBACA,mBACC,QAAQ;EAYL,SACJ,gBACA,kBACA,eACC,QAAQ;EAYL,UAAU,gBAAgB,mBAAmB,QAAQ"}
|
package/dist/client/index.d.mts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { a as PlayCardResult, c as GetJoinableGamesResult, d as DrawCardResult, f as CreateGameResult, i as ReportNoPlayableCardsResult, l as GetEventsAndClearAcknowledgedResult, n as StartGameResult, o as LeaveGameResult, r as SendChatResult, s as JoinGameResult, u as GetClientStateAndClearEventsResult } from "../index-S-oO1z9X.mjs";
|
|
2
|
+
import { d as ClientState, f as ChatMessage, l as GameEvent, p as Card } from "../index-BilCO_4a.mjs";
|
|
4
3
|
//#region src/client/Client.d.ts
|
|
5
4
|
declare class Client {
|
|
6
5
|
private readonly baseUrl;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/client/Client.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/client/Client.ts"],"mappings":";;;cAca;mBACM;EAEL,YAAA;EAIN,WAAW,sBAAsB,QAAQ;EAWzC,SAAS,gBAAgB,mBAAmB,QAAQ;EAYpD,6BACJ,gBACA,mBACC,QAAQ;EAeL,8BACJ,gBACA,kBACA,4BACC,QAAQ;EAeL,oBAAoB,QAAQ;EAQ5B,SAAS,gBAAgB,sBAAsB,QAAQ;EAavD,UAAU,gBAAgB,mBAAmB,QAAQ;EAYrD,SACJ,gBACA,kBACA,gBACA,gCACC,QAAQ;EAYL,sBACJ,gBACA,mBACC,QAAQ;EAYL,SACJ,gBACA,kBACA,eACC,QAAQ;EAYL,UAAU,gBAAgB,mBAAmB,QAAQ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/client/Client.ts"],"sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/client/Client.ts"],"sourcesContent":["import type {\n CreateGameResult,\n DrawCardResult,\n GetClientStateAndClearEventsResult,\n GetEventsAndClearAcknowledgedResult,\n GetJoinableGamesResult,\n JoinGameResult,\n LeaveGameResult,\n PlayCardResult,\n ReportNoPlayableCardsResult,\n SendChatResult,\n StartGameResult,\n} from \"../server/index.js\";\n\nexport class Client {\n private readonly baseUrl: string;\n\n constructor(baseUrl: string) {\n this.baseUrl = baseUrl;\n }\n\n async createGame(accessToken: string): Promise<CreateGameResult> {\n const response = await fetch(`${this.baseUrl}/createGame`, {\n method: \"POST\",\n headers: {\n Authorization: `Bearer ${accessToken}`,\n },\n });\n const result = await response.json();\n return result;\n }\n\n async drawCard(gameId: string, playerId: string): Promise<DrawCardResult> {\n const response = await fetch(`${this.baseUrl}/drawCard`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({ gameId, playerId }),\n });\n const result = await response.json();\n return result;\n }\n\n async getClientStateAndClearEvents(\n gameId: string,\n playerId: string,\n ): Promise<GetClientStateAndClearEventsResult> {\n const response = await fetch(\n `${this.baseUrl}/getClientStateAndClearEvents`,\n {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({ gameId, playerId }),\n },\n );\n const result = await response.json();\n return result;\n }\n\n async getEventsAndClearAcknowledged(\n gameId: string,\n playerId: string,\n lastReadId: string | null,\n ): Promise<GetEventsAndClearAcknowledgedResult> {\n const response = await fetch(\n `${this.baseUrl}/getEventsAndClearAcknowledged`,\n {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({ gameId, playerId, lastReadId }),\n },\n );\n const result = await response.json();\n return result;\n }\n\n async getJoinableGames(): Promise<GetJoinableGamesResult> {\n const response = await fetch(`${this.baseUrl}/getJoinableGames`, {\n method: \"POST\",\n });\n const result = await response.json();\n return result;\n }\n\n async joinGame(gameId: string, accessToken: string): Promise<JoinGameResult> {\n const response = await fetch(`${this.baseUrl}/joinGame`, {\n method: \"POST\",\n headers: {\n Authorization: `Bearer ${accessToken}`,\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({ gameId }),\n });\n const result = await response.json();\n return result;\n }\n\n async leaveGame(gameId: string, playerId: string): Promise<LeaveGameResult> {\n const response = await fetch(`${this.baseUrl}/leaveGame`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({ gameId, playerId }),\n });\n const result = await response.json();\n return result;\n }\n\n async playCard(\n gameId: string,\n playerId: string,\n cardId: string,\n isForOtherPlayerPile: boolean,\n ): Promise<PlayCardResult> {\n const response = await fetch(`${this.baseUrl}/playCard`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({ gameId, playerId, cardId, isForOtherPlayerPile }),\n });\n const result = await response.json();\n return result;\n }\n\n async reportNoPlayableCards(\n gameId: string,\n playerId: string,\n ): Promise<ReportNoPlayableCardsResult> {\n const response = await fetch(`${this.baseUrl}/reportNoPlayableCards`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({ gameId, playerId }),\n });\n const result = await response.json();\n return result;\n }\n\n async sendChat(\n gameId: string,\n playerId: string,\n text: string,\n ): Promise<SendChatResult> {\n const response = await fetch(`${this.baseUrl}/sendChat`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({ gameId, playerId, text }),\n });\n const result = await response.json();\n return result;\n }\n\n async startGame(gameId: string, playerId: string): Promise<StartGameResult> {\n const response = await fetch(`${this.baseUrl}/startGame`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({ gameId, playerId }),\n });\n const result = await response.json();\n return result;\n }\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
//#region src/manager/actions/createGame.d.ts
|
|
2
|
+
type CreateGameResult = {
|
|
3
|
+
readonly success: true;
|
|
4
|
+
readonly gameId: string;
|
|
5
|
+
readonly playerId: string;
|
|
6
|
+
} | {
|
|
7
|
+
readonly success: false;
|
|
8
|
+
readonly error: "maxGamesReached";
|
|
9
|
+
};
|
|
10
|
+
declare function createGame(userId: string, username: string): CreateGameResult;
|
|
11
|
+
//#endregion
|
|
12
|
+
//#region src/manager/actions/drawCard.d.ts
|
|
13
|
+
type DrawCardResult = {
|
|
14
|
+
readonly success: true;
|
|
15
|
+
} | {
|
|
16
|
+
readonly success: false;
|
|
17
|
+
readonly error: "gameNotFound" | "playerNotFound" | "invalidStatus" | "canPlayAtNotReached" | "handFull" | "drawPileEmpty";
|
|
18
|
+
};
|
|
19
|
+
declare function drawCard(gameId: string, playerId: string): DrawCardResult;
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region src/manager/types/Card.d.ts
|
|
22
|
+
type Card = {
|
|
23
|
+
readonly id: string;
|
|
24
|
+
readonly rank: 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14;
|
|
25
|
+
readonly suite: "clubs" | "diamonds" | "hearts" | "spades";
|
|
26
|
+
};
|
|
27
|
+
//#endregion
|
|
28
|
+
//#region src/manager/types/ChatMessage.d.ts
|
|
29
|
+
type ChatMessage = {
|
|
30
|
+
readonly id: string;
|
|
31
|
+
readonly username: string;
|
|
32
|
+
readonly text: string;
|
|
33
|
+
};
|
|
34
|
+
//#endregion
|
|
35
|
+
//#region src/manager/types/ClientState.d.ts
|
|
36
|
+
type ClientState = {
|
|
37
|
+
readonly status: "open" | "started" | "completed" | "forfeited";
|
|
38
|
+
readonly gameId: string;
|
|
39
|
+
readonly playerId: string;
|
|
40
|
+
readonly username: string;
|
|
41
|
+
readonly players: readonly Player[];
|
|
42
|
+
readonly expiresAt: number;
|
|
43
|
+
readonly chatMessages: readonly ChatMessage[];
|
|
44
|
+
readonly hand: readonly Card[];
|
|
45
|
+
readonly canPlayAt: number | null;
|
|
46
|
+
};
|
|
47
|
+
type Player = {
|
|
48
|
+
readonly username: string;
|
|
49
|
+
readonly handSize: number;
|
|
50
|
+
readonly drawPileSize: number;
|
|
51
|
+
readonly sidePileSize: number;
|
|
52
|
+
readonly centerPileTopCard: Card | null;
|
|
53
|
+
};
|
|
54
|
+
//#endregion
|
|
55
|
+
//#region src/manager/actions/getClientStateAndClearEvents.d.ts
|
|
56
|
+
type GetClientStateAndClearEventsResult = {
|
|
57
|
+
readonly success: true;
|
|
58
|
+
readonly state: ClientState;
|
|
59
|
+
} | {
|
|
60
|
+
readonly success: false;
|
|
61
|
+
readonly error: "gameNotFound" | "playerNotFound";
|
|
62
|
+
};
|
|
63
|
+
declare function getClientStateAndClearEvents(gameId: string, playerId: string): GetClientStateAndClearEventsResult;
|
|
64
|
+
//#endregion
|
|
65
|
+
//#region src/manager/types/GameEvent.d.ts
|
|
66
|
+
type GameEvent = {
|
|
67
|
+
readonly type: "canPlayAtUpdated";
|
|
68
|
+
readonly id: string;
|
|
69
|
+
readonly canPlayAt: number;
|
|
70
|
+
} | {
|
|
71
|
+
readonly type: "cardDrawnFromSidePileToCenterPile";
|
|
72
|
+
readonly id: string;
|
|
73
|
+
readonly username: string;
|
|
74
|
+
readonly card: Card;
|
|
75
|
+
} | {
|
|
76
|
+
readonly type: "cardPlayed";
|
|
77
|
+
readonly id: string;
|
|
78
|
+
readonly username: string;
|
|
79
|
+
readonly card: Card;
|
|
80
|
+
readonly isForOtherPlayerPile: boolean;
|
|
81
|
+
} | {
|
|
82
|
+
readonly type: "chat";
|
|
83
|
+
readonly id: string;
|
|
84
|
+
readonly message: ChatMessage;
|
|
85
|
+
} | {
|
|
86
|
+
readonly type: "drewCard";
|
|
87
|
+
readonly id: string;
|
|
88
|
+
readonly card: Card;
|
|
89
|
+
} | {
|
|
90
|
+
readonly type: "expirationUpdated";
|
|
91
|
+
readonly id: string;
|
|
92
|
+
readonly expiresAt: number;
|
|
93
|
+
} | {
|
|
94
|
+
readonly type: "gameCompleted";
|
|
95
|
+
readonly id: string;
|
|
96
|
+
} | {
|
|
97
|
+
readonly type: "gameForfeited";
|
|
98
|
+
readonly id: string;
|
|
99
|
+
} | {
|
|
100
|
+
readonly type: "gameStarted";
|
|
101
|
+
readonly id: string;
|
|
102
|
+
} | {
|
|
103
|
+
readonly type: "handInitialized";
|
|
104
|
+
readonly id: string;
|
|
105
|
+
readonly cards: readonly Card[];
|
|
106
|
+
} | {
|
|
107
|
+
readonly type: "playerCenterPileInitialized";
|
|
108
|
+
readonly id: string;
|
|
109
|
+
readonly username: string;
|
|
110
|
+
readonly card: Card;
|
|
111
|
+
} | {
|
|
112
|
+
readonly type: "playerDrawPileInitialized";
|
|
113
|
+
readonly id: string;
|
|
114
|
+
readonly username: string;
|
|
115
|
+
readonly numCards: number;
|
|
116
|
+
} | {
|
|
117
|
+
readonly type: "playerDrewCard";
|
|
118
|
+
readonly id: string;
|
|
119
|
+
readonly username: string;
|
|
120
|
+
} | {
|
|
121
|
+
readonly type: "playerHandInitialized";
|
|
122
|
+
readonly id: string;
|
|
123
|
+
readonly username: string;
|
|
124
|
+
readonly numCards: number;
|
|
125
|
+
} | {
|
|
126
|
+
readonly type: "playerJoined";
|
|
127
|
+
readonly id: string;
|
|
128
|
+
readonly username: string;
|
|
129
|
+
} | {
|
|
130
|
+
readonly type: "playerLeft";
|
|
131
|
+
readonly id: string;
|
|
132
|
+
readonly username: string;
|
|
133
|
+
} | {
|
|
134
|
+
readonly type: "playerSidePileInitialized";
|
|
135
|
+
readonly id: string;
|
|
136
|
+
readonly username: string;
|
|
137
|
+
readonly numCards: number;
|
|
138
|
+
};
|
|
139
|
+
//#endregion
|
|
140
|
+
//#region src/manager/actions/getEventsAndClearAcknowledged.d.ts
|
|
141
|
+
type GetEventsAndClearAcknowledgedResult = {
|
|
142
|
+
readonly success: true;
|
|
143
|
+
readonly events: readonly GameEvent[];
|
|
144
|
+
} | {
|
|
145
|
+
readonly success: false;
|
|
146
|
+
readonly error: "gameNotFound" | "playerNotFound";
|
|
147
|
+
};
|
|
148
|
+
declare function getEventsAndClearAcknowledged(gameId: string, playerId: string, lastReadId: string | null): GetEventsAndClearAcknowledgedResult;
|
|
149
|
+
//#endregion
|
|
150
|
+
//#region src/manager/actions/getJoinableGames.d.ts
|
|
151
|
+
type GetJoinableGamesResult = {
|
|
152
|
+
readonly success: true;
|
|
153
|
+
readonly games: readonly {
|
|
154
|
+
readonly id: string;
|
|
155
|
+
readonly numPlayers: number;
|
|
156
|
+
}[];
|
|
157
|
+
};
|
|
158
|
+
declare function getJoinableGames(): GetJoinableGamesResult;
|
|
159
|
+
//#endregion
|
|
160
|
+
//#region src/manager/actions/joinGame.d.ts
|
|
161
|
+
type JoinGameResult = {
|
|
162
|
+
readonly success: true;
|
|
163
|
+
readonly playerId: string;
|
|
164
|
+
} | {
|
|
165
|
+
readonly success: false;
|
|
166
|
+
readonly error: "gameNotFound" | "invalidStatus" | "maxPlayersReached" | "alreadyInGame";
|
|
167
|
+
};
|
|
168
|
+
declare function joinGame(gameId: string, userId: string, username: string): JoinGameResult;
|
|
169
|
+
//#endregion
|
|
170
|
+
//#region src/manager/actions/leaveGame.d.ts
|
|
171
|
+
type LeaveGameResult = {
|
|
172
|
+
readonly success: true;
|
|
173
|
+
} | {
|
|
174
|
+
readonly success: false;
|
|
175
|
+
readonly error: "gameNotFound" | "playerNotFound";
|
|
176
|
+
};
|
|
177
|
+
declare function leaveGame(gameId: string, playerId: string): LeaveGameResult;
|
|
178
|
+
//#endregion
|
|
179
|
+
//#region src/manager/actions/playCard.d.ts
|
|
180
|
+
type PlayCardResult = {
|
|
181
|
+
readonly success: true;
|
|
182
|
+
} | {
|
|
183
|
+
readonly success: false;
|
|
184
|
+
readonly error: "gameNotFound" | "playerNotFound" | "invalidStatus" | "canPlayAtNotReached" | "cardNotFound" | "cardNotPlayable";
|
|
185
|
+
};
|
|
186
|
+
declare function playCard(gameId: string, playerId: string, cardId: string, isForOtherPlayerPile: boolean): PlayCardResult;
|
|
187
|
+
//#endregion
|
|
188
|
+
//#region src/manager/actions/reportNoPlayableCards.d.ts
|
|
189
|
+
type ReportNoPlayableCardsResult = {
|
|
190
|
+
readonly success: true;
|
|
191
|
+
} | {
|
|
192
|
+
readonly success: false;
|
|
193
|
+
readonly error: "gameNotFound" | "playerNotFound" | "invalidStatus" | "canPlayAtNotReached" | "alreadyReported" | "hasPlayableCard" | "canDraw";
|
|
194
|
+
};
|
|
195
|
+
declare function reportNoPlayableCards(gameId: string, playerId: string): ReportNoPlayableCardsResult;
|
|
196
|
+
//#endregion
|
|
197
|
+
//#region src/manager/actions/sendChat.d.ts
|
|
198
|
+
type SendChatResult = {
|
|
199
|
+
readonly success: true;
|
|
200
|
+
} | {
|
|
201
|
+
readonly success: false;
|
|
202
|
+
readonly error: "gameNotFound" | "playerNotFound";
|
|
203
|
+
};
|
|
204
|
+
declare function sendChat(gameId: string, playerId: string, text: string): SendChatResult;
|
|
205
|
+
//#endregion
|
|
206
|
+
//#region src/manager/actions/startGame.d.ts
|
|
207
|
+
type StartGameResult = {
|
|
208
|
+
readonly success: true;
|
|
209
|
+
} | {
|
|
210
|
+
readonly success: false;
|
|
211
|
+
readonly error: "gameNotFound" | "playerNotFound" | "invalidStatus" | "playerNotAdmin" | "minPlayersNotReached";
|
|
212
|
+
};
|
|
213
|
+
declare function startGame(gameId: string, playerId: string): StartGameResult;
|
|
214
|
+
//#endregion
|
|
215
|
+
export { leaveGame as a, getEventsAndClearAcknowledged as c, ClientState as d, ChatMessage as f, createGame as h, playCard as i, GameEvent as l, drawCard as m, sendChat as n, joinGame as o, Card as p, reportNoPlayableCards as r, getJoinableGames as s, startGame as t, getClientStateAndClearEvents as u };
|
|
216
|
+
//# sourceMappingURL=index-BilCO_4a.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-BilCO_4a.d.cts","names":[],"sources":["../src/manager/actions/createGame.ts","../src/manager/actions/drawCard.ts","../src/manager/types/Card.ts","../src/manager/types/ChatMessage.ts","../src/manager/types/ClientState.ts","../src/manager/actions/getClientStateAndClearEvents.ts","../src/manager/types/GameEvent.ts","../src/manager/actions/getEventsAndClearAcknowledged.ts","../src/manager/actions/getJoinableGames.ts","../src/manager/actions/joinGame.ts","../src/manager/actions/leaveGame.ts","../src/manager/actions/playCard.ts","../src/manager/actions/reportNoPlayableCards.ts","../src/manager/actions/sendChat.ts","../src/manager/actions/startGame.ts"],"mappings":";KAKK;WAEU;WACA;WACA;;WAGA;WACA;;iBAGC,WAAW,gBAAgB,mBAAmB;;;KCXzD;WAEU;;WAGA;WACA;;iBASC,SAAS,gBAAgB,mBAAmB;;;KCpBhD;WACD;WACA;WACA;;;;KCHC;WACD;WACA;WACA;;;;KCAC;WACD;WACA;WACA;WACA;WACA,kBAAkB;WAClB;WACA,uBAAuB;WACvB,eAAe;WACf;;KAGN;WACM;WACA;WACA;WACA;WACA,mBAAmB;;;;KCjBzB;WAEU;WACA,OAAO;;WAGP;WACA;;iBAGC,6BACd,gBACA,mBACC;;;KCbS;WAEG;WACA;WACA;;WAGA;WACA;WACA;WACA,MAAM;;WAGN;WACA;WACA;WACA,MAAM;WACN;;WAGA;WACA;WACA,SAAS;;WAGT;WACA;WACA,MAAM;;WAGN;WACA;WACA;;WAGA;WACA;;WAGA;WACA;;WAGA;WACA;;WAGA;WACA;WACA,gBAAgB;;WAGhB;WACA;WACA;WACA,MAAM;;WAGN;WACA;WACA;WACA;;WAGA;WACA;WACA;;WAGA;WACA;WACA;WACA;;WAGA;WACA;WACA;;WAGA;WACA;WACA;;WAGA;WACA;WACA;WACA;;;;KCxFV;WAEU;WACA,iBAAiB;;WAGjB;WACA;;iBAGC,8BACd,gBACA,kBACA,4BACC;;;KCdE;WACM;WACA;aACE;aACA;;;iBAIG,oBAAoB;;;KCN/B;WAEU;WACA;;WAGA;WACA;;iBAOC,SACd,gBACA,gBACA,mBACC;;;KClBE;WAEU;;WAGA;WACA;;iBAGC,UAAU,gBAAgB,mBAAmB;;;KCPxD;WAEU;;WAGA;WACA;;iBASC,SACd,gBACA,kBACA,gBACA,gCACC;;;KCjBE;WAEU;;WAGA;WACA;;iBAUC,sBACd,gBACA,mBACC;;;KCzBE;WAEU;;WAGA;WACA;;iBAGC,SACd,gBACA,kBACA,eACC;;;KCLE;WAEU;;WAGA;WACA;;iBAQC,UAAU,gBAAgB,mBAAmB"}
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
//#region src/manager/actions/createGame.d.ts
|
|
2
|
+
type CreateGameResult = {
|
|
3
|
+
readonly success: true;
|
|
4
|
+
readonly gameId: string;
|
|
5
|
+
readonly playerId: string;
|
|
6
|
+
} | {
|
|
7
|
+
readonly success: false;
|
|
8
|
+
readonly error: "maxGamesReached";
|
|
9
|
+
};
|
|
10
|
+
declare function createGame(userId: string, username: string): CreateGameResult;
|
|
11
|
+
//#endregion
|
|
12
|
+
//#region src/manager/actions/drawCard.d.ts
|
|
13
|
+
type DrawCardResult = {
|
|
14
|
+
readonly success: true;
|
|
15
|
+
} | {
|
|
16
|
+
readonly success: false;
|
|
17
|
+
readonly error: "gameNotFound" | "playerNotFound" | "invalidStatus" | "canPlayAtNotReached" | "handFull" | "drawPileEmpty";
|
|
18
|
+
};
|
|
19
|
+
declare function drawCard(gameId: string, playerId: string): DrawCardResult;
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region src/manager/types/Card.d.ts
|
|
22
|
+
type Card = {
|
|
23
|
+
readonly id: string;
|
|
24
|
+
readonly rank: 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14;
|
|
25
|
+
readonly suite: "clubs" | "diamonds" | "hearts" | "spades";
|
|
26
|
+
};
|
|
27
|
+
//#endregion
|
|
28
|
+
//#region src/manager/types/ChatMessage.d.ts
|
|
29
|
+
type ChatMessage = {
|
|
30
|
+
readonly id: string;
|
|
31
|
+
readonly username: string;
|
|
32
|
+
readonly text: string;
|
|
33
|
+
};
|
|
34
|
+
//#endregion
|
|
35
|
+
//#region src/manager/types/ClientState.d.ts
|
|
36
|
+
type ClientState = {
|
|
37
|
+
readonly status: "open" | "started" | "completed" | "forfeited";
|
|
38
|
+
readonly gameId: string;
|
|
39
|
+
readonly playerId: string;
|
|
40
|
+
readonly username: string;
|
|
41
|
+
readonly players: readonly Player[];
|
|
42
|
+
readonly expiresAt: number;
|
|
43
|
+
readonly chatMessages: readonly ChatMessage[];
|
|
44
|
+
readonly hand: readonly Card[];
|
|
45
|
+
readonly canPlayAt: number | null;
|
|
46
|
+
};
|
|
47
|
+
type Player = {
|
|
48
|
+
readonly username: string;
|
|
49
|
+
readonly handSize: number;
|
|
50
|
+
readonly drawPileSize: number;
|
|
51
|
+
readonly sidePileSize: number;
|
|
52
|
+
readonly centerPileTopCard: Card | null;
|
|
53
|
+
};
|
|
54
|
+
//#endregion
|
|
55
|
+
//#region src/manager/actions/getClientStateAndClearEvents.d.ts
|
|
56
|
+
type GetClientStateAndClearEventsResult = {
|
|
57
|
+
readonly success: true;
|
|
58
|
+
readonly state: ClientState;
|
|
59
|
+
} | {
|
|
60
|
+
readonly success: false;
|
|
61
|
+
readonly error: "gameNotFound" | "playerNotFound";
|
|
62
|
+
};
|
|
63
|
+
declare function getClientStateAndClearEvents(gameId: string, playerId: string): GetClientStateAndClearEventsResult;
|
|
64
|
+
//#endregion
|
|
65
|
+
//#region src/manager/types/GameEvent.d.ts
|
|
66
|
+
type GameEvent = {
|
|
67
|
+
readonly type: "canPlayAtUpdated";
|
|
68
|
+
readonly id: string;
|
|
69
|
+
readonly canPlayAt: number;
|
|
70
|
+
} | {
|
|
71
|
+
readonly type: "cardDrawnFromSidePileToCenterPile";
|
|
72
|
+
readonly id: string;
|
|
73
|
+
readonly username: string;
|
|
74
|
+
readonly card: Card;
|
|
75
|
+
} | {
|
|
76
|
+
readonly type: "cardPlayed";
|
|
77
|
+
readonly id: string;
|
|
78
|
+
readonly username: string;
|
|
79
|
+
readonly card: Card;
|
|
80
|
+
readonly isForOtherPlayerPile: boolean;
|
|
81
|
+
} | {
|
|
82
|
+
readonly type: "chat";
|
|
83
|
+
readonly id: string;
|
|
84
|
+
readonly message: ChatMessage;
|
|
85
|
+
} | {
|
|
86
|
+
readonly type: "drewCard";
|
|
87
|
+
readonly id: string;
|
|
88
|
+
readonly card: Card;
|
|
89
|
+
} | {
|
|
90
|
+
readonly type: "expirationUpdated";
|
|
91
|
+
readonly id: string;
|
|
92
|
+
readonly expiresAt: number;
|
|
93
|
+
} | {
|
|
94
|
+
readonly type: "gameCompleted";
|
|
95
|
+
readonly id: string;
|
|
96
|
+
} | {
|
|
97
|
+
readonly type: "gameForfeited";
|
|
98
|
+
readonly id: string;
|
|
99
|
+
} | {
|
|
100
|
+
readonly type: "gameStarted";
|
|
101
|
+
readonly id: string;
|
|
102
|
+
} | {
|
|
103
|
+
readonly type: "handInitialized";
|
|
104
|
+
readonly id: string;
|
|
105
|
+
readonly cards: readonly Card[];
|
|
106
|
+
} | {
|
|
107
|
+
readonly type: "playerCenterPileInitialized";
|
|
108
|
+
readonly id: string;
|
|
109
|
+
readonly username: string;
|
|
110
|
+
readonly card: Card;
|
|
111
|
+
} | {
|
|
112
|
+
readonly type: "playerDrawPileInitialized";
|
|
113
|
+
readonly id: string;
|
|
114
|
+
readonly username: string;
|
|
115
|
+
readonly numCards: number;
|
|
116
|
+
} | {
|
|
117
|
+
readonly type: "playerDrewCard";
|
|
118
|
+
readonly id: string;
|
|
119
|
+
readonly username: string;
|
|
120
|
+
} | {
|
|
121
|
+
readonly type: "playerHandInitialized";
|
|
122
|
+
readonly id: string;
|
|
123
|
+
readonly username: string;
|
|
124
|
+
readonly numCards: number;
|
|
125
|
+
} | {
|
|
126
|
+
readonly type: "playerJoined";
|
|
127
|
+
readonly id: string;
|
|
128
|
+
readonly username: string;
|
|
129
|
+
} | {
|
|
130
|
+
readonly type: "playerLeft";
|
|
131
|
+
readonly id: string;
|
|
132
|
+
readonly username: string;
|
|
133
|
+
} | {
|
|
134
|
+
readonly type: "playerSidePileInitialized";
|
|
135
|
+
readonly id: string;
|
|
136
|
+
readonly username: string;
|
|
137
|
+
readonly numCards: number;
|
|
138
|
+
};
|
|
139
|
+
//#endregion
|
|
140
|
+
//#region src/manager/actions/getEventsAndClearAcknowledged.d.ts
|
|
141
|
+
type GetEventsAndClearAcknowledgedResult = {
|
|
142
|
+
readonly success: true;
|
|
143
|
+
readonly events: readonly GameEvent[];
|
|
144
|
+
} | {
|
|
145
|
+
readonly success: false;
|
|
146
|
+
readonly error: "gameNotFound" | "playerNotFound";
|
|
147
|
+
};
|
|
148
|
+
declare function getEventsAndClearAcknowledged(gameId: string, playerId: string, lastReadId: string | null): GetEventsAndClearAcknowledgedResult;
|
|
149
|
+
//#endregion
|
|
150
|
+
//#region src/manager/actions/getJoinableGames.d.ts
|
|
151
|
+
type GetJoinableGamesResult = {
|
|
152
|
+
readonly success: true;
|
|
153
|
+
readonly games: readonly {
|
|
154
|
+
readonly id: string;
|
|
155
|
+
readonly numPlayers: number;
|
|
156
|
+
}[];
|
|
157
|
+
};
|
|
158
|
+
declare function getJoinableGames(): GetJoinableGamesResult;
|
|
159
|
+
//#endregion
|
|
160
|
+
//#region src/manager/actions/joinGame.d.ts
|
|
161
|
+
type JoinGameResult = {
|
|
162
|
+
readonly success: true;
|
|
163
|
+
readonly playerId: string;
|
|
164
|
+
} | {
|
|
165
|
+
readonly success: false;
|
|
166
|
+
readonly error: "gameNotFound" | "invalidStatus" | "maxPlayersReached" | "alreadyInGame";
|
|
167
|
+
};
|
|
168
|
+
declare function joinGame(gameId: string, userId: string, username: string): JoinGameResult;
|
|
169
|
+
//#endregion
|
|
170
|
+
//#region src/manager/actions/leaveGame.d.ts
|
|
171
|
+
type LeaveGameResult = {
|
|
172
|
+
readonly success: true;
|
|
173
|
+
} | {
|
|
174
|
+
readonly success: false;
|
|
175
|
+
readonly error: "gameNotFound" | "playerNotFound";
|
|
176
|
+
};
|
|
177
|
+
declare function leaveGame(gameId: string, playerId: string): LeaveGameResult;
|
|
178
|
+
//#endregion
|
|
179
|
+
//#region src/manager/actions/playCard.d.ts
|
|
180
|
+
type PlayCardResult = {
|
|
181
|
+
readonly success: true;
|
|
182
|
+
} | {
|
|
183
|
+
readonly success: false;
|
|
184
|
+
readonly error: "gameNotFound" | "playerNotFound" | "invalidStatus" | "canPlayAtNotReached" | "cardNotFound" | "cardNotPlayable";
|
|
185
|
+
};
|
|
186
|
+
declare function playCard(gameId: string, playerId: string, cardId: string, isForOtherPlayerPile: boolean): PlayCardResult;
|
|
187
|
+
//#endregion
|
|
188
|
+
//#region src/manager/actions/reportNoPlayableCards.d.ts
|
|
189
|
+
type ReportNoPlayableCardsResult = {
|
|
190
|
+
readonly success: true;
|
|
191
|
+
} | {
|
|
192
|
+
readonly success: false;
|
|
193
|
+
readonly error: "gameNotFound" | "playerNotFound" | "invalidStatus" | "canPlayAtNotReached" | "alreadyReported" | "hasPlayableCard" | "canDraw";
|
|
194
|
+
};
|
|
195
|
+
declare function reportNoPlayableCards(gameId: string, playerId: string): ReportNoPlayableCardsResult;
|
|
196
|
+
//#endregion
|
|
197
|
+
//#region src/manager/actions/sendChat.d.ts
|
|
198
|
+
type SendChatResult = {
|
|
199
|
+
readonly success: true;
|
|
200
|
+
} | {
|
|
201
|
+
readonly success: false;
|
|
202
|
+
readonly error: "gameNotFound" | "playerNotFound";
|
|
203
|
+
};
|
|
204
|
+
declare function sendChat(gameId: string, playerId: string, text: string): SendChatResult;
|
|
205
|
+
//#endregion
|
|
206
|
+
//#region src/manager/actions/startGame.d.ts
|
|
207
|
+
type StartGameResult = {
|
|
208
|
+
readonly success: true;
|
|
209
|
+
} | {
|
|
210
|
+
readonly success: false;
|
|
211
|
+
readonly error: "gameNotFound" | "playerNotFound" | "invalidStatus" | "playerNotAdmin" | "minPlayersNotReached";
|
|
212
|
+
};
|
|
213
|
+
declare function startGame(gameId: string, playerId: string): StartGameResult;
|
|
214
|
+
//#endregion
|
|
215
|
+
export { leaveGame as a, getEventsAndClearAcknowledged as c, ClientState as d, ChatMessage as f, createGame as h, playCard as i, GameEvent as l, drawCard as m, sendChat as n, joinGame as o, Card as p, reportNoPlayableCards as r, getJoinableGames as s, startGame as t, getClientStateAndClearEvents as u };
|
|
216
|
+
//# sourceMappingURL=index-BilCO_4a.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-BilCO_4a.d.mts","names":[],"sources":["../src/manager/actions/createGame.ts","../src/manager/actions/drawCard.ts","../src/manager/types/Card.ts","../src/manager/types/ChatMessage.ts","../src/manager/types/ClientState.ts","../src/manager/actions/getClientStateAndClearEvents.ts","../src/manager/types/GameEvent.ts","../src/manager/actions/getEventsAndClearAcknowledged.ts","../src/manager/actions/getJoinableGames.ts","../src/manager/actions/joinGame.ts","../src/manager/actions/leaveGame.ts","../src/manager/actions/playCard.ts","../src/manager/actions/reportNoPlayableCards.ts","../src/manager/actions/sendChat.ts","../src/manager/actions/startGame.ts"],"mappings":";KAKK;WAEU;WACA;WACA;;WAGA;WACA;;iBAGC,WAAW,gBAAgB,mBAAmB;;;KCXzD;WAEU;;WAGA;WACA;;iBASC,SAAS,gBAAgB,mBAAmB;;;KCpBhD;WACD;WACA;WACA;;;;KCHC;WACD;WACA;WACA;;;;KCAC;WACD;WACA;WACA;WACA;WACA,kBAAkB;WAClB;WACA,uBAAuB;WACvB,eAAe;WACf;;KAGN;WACM;WACA;WACA;WACA;WACA,mBAAmB;;;;KCjBzB;WAEU;WACA,OAAO;;WAGP;WACA;;iBAGC,6BACd,gBACA,mBACC;;;KCbS;WAEG;WACA;WACA;;WAGA;WACA;WACA;WACA,MAAM;;WAGN;WACA;WACA;WACA,MAAM;WACN;;WAGA;WACA;WACA,SAAS;;WAGT;WACA;WACA,MAAM;;WAGN;WACA;WACA;;WAGA;WACA;;WAGA;WACA;;WAGA;WACA;;WAGA;WACA;WACA,gBAAgB;;WAGhB;WACA;WACA;WACA,MAAM;;WAGN;WACA;WACA;WACA;;WAGA;WACA;WACA;;WAGA;WACA;WACA;WACA;;WAGA;WACA;WACA;;WAGA;WACA;WACA;;WAGA;WACA;WACA;WACA;;;;KCxFV;WAEU;WACA,iBAAiB;;WAGjB;WACA;;iBAGC,8BACd,gBACA,kBACA,4BACC;;;KCdE;WACM;WACA;aACE;aACA;;;iBAIG,oBAAoB;;;KCN/B;WAEU;WACA;;WAGA;WACA;;iBAOC,SACd,gBACA,gBACA,mBACC;;;KClBE;WAEU;;WAGA;WACA;;iBAGC,UAAU,gBAAgB,mBAAmB;;;KCPxD;WAEU;;WAGA;WACA;;iBASC,SACd,gBACA,kBACA,gBACA,gCACC;;;KCjBE;WAEU;;WAGA;WACA;;iBAUC,sBACd,gBACA,mBACC;;;KCzBE;WAEU;;WAGA;WACA;;iBAGC,SACd,gBACA,kBACA,eACC;;;KCLE;WAEU;;WAGA;WACA;;iBAQC,UAAU,gBAAgB,mBAAmB"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { d as ClientState, l as GameEvent } from "./index-BilCO_4a.cjs";
|
|
3
2
|
//#region src/server/actions/createGame.d.ts
|
|
4
3
|
type CreateGameResult = {
|
|
5
4
|
readonly success: true;
|
|
@@ -104,5 +103,41 @@ type StartGameResult = {
|
|
|
104
103
|
};
|
|
105
104
|
declare function startGame(input: unknown): StartGameResult;
|
|
106
105
|
//#endregion
|
|
107
|
-
|
|
108
|
-
|
|
106
|
+
//#region src/server/index.d.ts
|
|
107
|
+
declare const actions: readonly [{
|
|
108
|
+
readonly path: "/createGame";
|
|
109
|
+
readonly action: typeof createGame;
|
|
110
|
+
}, {
|
|
111
|
+
readonly path: "/drawCard";
|
|
112
|
+
readonly action: typeof drawCard;
|
|
113
|
+
}, {
|
|
114
|
+
readonly path: "/getClientStateAndClearEvents";
|
|
115
|
+
readonly action: typeof getClientStateAndClearEvents;
|
|
116
|
+
}, {
|
|
117
|
+
readonly path: "/getEventsAndClearAcknowledged";
|
|
118
|
+
readonly action: typeof getEventsAndClearAcknowledged;
|
|
119
|
+
}, {
|
|
120
|
+
readonly path: "/getJoinableGames";
|
|
121
|
+
readonly action: typeof getJoinableGames;
|
|
122
|
+
}, {
|
|
123
|
+
readonly path: "/joinGame";
|
|
124
|
+
readonly action: typeof joinGame;
|
|
125
|
+
}, {
|
|
126
|
+
readonly path: "/leaveGame";
|
|
127
|
+
readonly action: typeof leaveGame;
|
|
128
|
+
}, {
|
|
129
|
+
readonly path: "/playCard";
|
|
130
|
+
readonly action: typeof playCard;
|
|
131
|
+
}, {
|
|
132
|
+
readonly path: "/reportNoPlayableCards";
|
|
133
|
+
readonly action: typeof reportNoPlayableCards;
|
|
134
|
+
}, {
|
|
135
|
+
readonly path: "/sendChat";
|
|
136
|
+
readonly action: typeof sendChat;
|
|
137
|
+
}, {
|
|
138
|
+
readonly path: "/startGame";
|
|
139
|
+
readonly action: typeof startGame;
|
|
140
|
+
}];
|
|
141
|
+
//#endregion
|
|
142
|
+
export { PlayCardResult as a, GetJoinableGamesResult as c, DrawCardResult as d, CreateGameResult as f, ReportNoPlayableCardsResult as i, GetEventsAndClearAcknowledgedResult as l, StartGameResult as n, LeaveGameResult as o, SendChatResult as r, JoinGameResult as s, actions as t, GetClientStateAndClearEventsResult as u };
|
|
143
|
+
//# sourceMappingURL=index-DSPZZlhq.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-DSPZZlhq.d.cts","names":[],"sources":["../src/server/actions/createGame.ts","../src/server/actions/drawCard.ts","../src/server/actions/getClientStateAndClearEvents.ts","../src/server/actions/getEventsAndClearAcknowledged.ts","../src/server/actions/getJoinableGames.ts","../src/server/actions/joinGame.ts","../src/server/actions/leaveGame.ts","../src/server/actions/playCard.ts","../src/server/actions/reportNoPlayableCards.ts","../src/server/actions/sendChat.ts","../src/server/actions/startGame.ts","../src/server/index.ts"],"mappings":";;KAEY;WAEG;WACA;WACA;;WAGA;WACA;;iBAGC,WAAW,gBAAgB,mBAAmB;;;KCVlD;WAEG;;WAGA;WACA;;iBAiBC,SAAS,iBAAiB;;;KCtB9B;WAEG;WACA,OAAO;;WAGP;WACA;;iBAUC,6BACd,iBACC;;;KCnBS;WAEG;WACA,iBAAiB;;WAGjB;WACA;;iBAcC,8BACd,iBACC;;;KCzBS;WACD;aACE;aACA;;;iBAIG,oBAAoB;;;KCNxB;WAEG;WACA;;WAGA;WACA;;iBAcC,SACd,gBACA,gBACA,mBACC;;;KCzBS;WAEG;;WAGA;WACA;;iBAUC,UAAU,iBAAiB;;;KChB/B;WAEG;;WAGA;WACA;;iBAsBC,SAAS,iBAAiB;;;KC5B9B;WAEG;;WAGA;WACA;;iBAkBC,sBACd,iBACC;;;KC1BS;WAEG;;WAGA;WACA;;iBAWC,SAAS,iBAAiB;;;KCjB9B;WAEG;;WAGA;WACA;;iBAgBC,UAAU,iBAAiB;;;cCM9B"}
|