trucoshi 0.6.4 → 0.6.7
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/types.d.ts +10 -3
- package/package.json +1 -1
package/dist/types.d.ts
CHANGED
|
@@ -33,8 +33,10 @@ export interface IPublicMatch {
|
|
|
33
33
|
teams: Array<IPublicTeam>;
|
|
34
34
|
players: Array<IPublicPlayer>;
|
|
35
35
|
me: IPublicPlayer | null;
|
|
36
|
-
|
|
36
|
+
freshHand: boolean;
|
|
37
37
|
rounds: IPlayedCard[][];
|
|
38
|
+
lastCard?: ICard | null;
|
|
39
|
+
lastCommand?: ECommand | number | null;
|
|
38
40
|
}
|
|
39
41
|
export interface IPublicMatchInfo {
|
|
40
42
|
ownerId: string;
|
|
@@ -59,6 +61,9 @@ export interface IChatMessage {
|
|
|
59
61
|
export interface IChatRoom {
|
|
60
62
|
id: string;
|
|
61
63
|
messages: Array<IChatMessage>;
|
|
64
|
+
socket: {
|
|
65
|
+
emit(socket: string): void;
|
|
66
|
+
};
|
|
62
67
|
send(user: IChatMessage["user"], message: string): void;
|
|
63
68
|
card(user: IChatMessage["user"], card: ICard): void;
|
|
64
69
|
command(team: 0 | 1, command: ECommand | number): void;
|
|
@@ -138,7 +143,7 @@ export interface ServerToClientEvents {
|
|
|
138
143
|
[EServerEvent.PREVIOUS_HAND]: (value: IMatchPreviousHand, callback: () => void) => void;
|
|
139
144
|
[EServerEvent.UPDATE_CHAT]: (room: IPublicChatRoom, message?: IChatMessage) => void;
|
|
140
145
|
[EServerEvent.UPDATE_ACTIVE_MATCHES]: (activeMatches: IPublicMatchInfo[]) => void;
|
|
141
|
-
[EServerEvent.UPDATE_MATCH]: (match: IPublicMatch) => void;
|
|
146
|
+
[EServerEvent.UPDATE_MATCH]: (match: IPublicMatch, callback?: () => void) => void;
|
|
142
147
|
[EServerEvent.PLAYER_USED_CARD]: (match: IPublicMatch, card: IPlayedCard) => void;
|
|
143
148
|
[EServerEvent.PLAYER_SAID_COMMAND]: (match: IPublicMatch, command: ISaidCommand) => void;
|
|
144
149
|
[EServerEvent.WAITING_PLAY]: (match: IPublicMatch, callback: (data: IWaitingPlayData) => void) => void;
|
|
@@ -154,7 +159,9 @@ export interface ClientToServerEvents {
|
|
|
154
159
|
[EClientEvent.START_MATCH]: (matchId: string, callback: IEventCallback<{
|
|
155
160
|
matchSessionId?: string;
|
|
156
161
|
}>) => void;
|
|
157
|
-
[EClientEvent.FETCH_MATCH]: (session: string | null, matchId: string, callback: IEventCallback
|
|
162
|
+
[EClientEvent.FETCH_MATCH]: (session: string | null, matchId: string, callback: IEventCallback<{
|
|
163
|
+
match: IPublicMatch | null;
|
|
164
|
+
}>) => void;
|
|
158
165
|
[EClientEvent.LIST_MATCHES]: (filters: {
|
|
159
166
|
state?: Array<EMatchState>;
|
|
160
167
|
}, callback: IEventCallback<{
|