Add interfaces for each event's data
This commit is contained in:
parent
cfb915724f
commit
1063126164
12 changed files with 36 additions and 14 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import { Socket } from 'socket.io';
|
||||
export const ChancellorNomination = (socket: Socket, data: any) => {
|
||||
export const ChancellorNomination = (socket: Socket, data: ChancellorNomination) => {
|
||||
console.log(`ChancellorNomination event`);
|
||||
};
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
import { Socket } from 'socket.io';
|
||||
export const ChancellorPolicy = (socket: Socket, data: any) => {
|
||||
export const ChancellorPolicy = (socket: Socket, data: ChancellorPolicy) => {
|
||||
console.log(`Chancellor policy`);
|
||||
};
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
import { Socket } from 'socket.io';
|
||||
export const PresidentPolicies = (socket: Socket, data: any) => {
|
||||
export const PresidentPolicies = (socket: Socket, data: PresidentPolicies) => {
|
||||
console.log(`Received Presidential policies`);
|
||||
};
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
import { Socket } from 'socket.io';
|
||||
export const StartGame = (socket: Socket, data: any) => {
|
||||
export const StartGame = (socket: Socket, data: StartGame) => {
|
||||
console.log(`Game starting`);
|
||||
};
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
import { Socket } from 'socket.io';
|
||||
export const VetoConfirm = (socket: Socket, data: any) => {
|
||||
export const VetoConfirm = (socket: Socket, data: VetoConfirm) => {
|
||||
console.log(`President's veto confirmation`);
|
||||
};
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
import { Socket } from 'socket.io';
|
||||
export const VetoRequest = (socket: Socket, data: any) => {
|
||||
export const VetoRequest = (socket: Socket, data: VetoRequest) => {
|
||||
console.log(`Chancellor requesting veto`);
|
||||
};
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
import { Socket } from 'socket.io';
|
||||
export const Vote = (socket: Socket, data: any) => {
|
||||
export const Vote = (socket: Socket, data: Vote) => {
|
||||
console.log(`Vote received`);
|
||||
};
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
import { Socket } from 'socket.io';
|
||||
export const ExecutePlayer = (socket: Socket, data: any) => {
|
||||
export const ExecutePlayer = (socket: Socket, data: ExecutePlayer) => {
|
||||
console.log(`Killing a player`);
|
||||
};
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
import { Socket } from 'socket.io';
|
||||
export const ExecutiveConfirmation = (socket: Socket, data: any) => {
|
||||
export const ExecutiveConfirmation = (socket: Socket, data: ExecutiveConfirmation) => {
|
||||
console.log(`Just a plain ole confirmation`);
|
||||
};
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
import { Socket } from 'socket.io';
|
||||
export const InvestigateAffiliation = (socket: Socket, data: any) => {
|
||||
export const InvestigateAffiliation = (socket: Socket, data: InvestigateAffiliation) => {
|
||||
console.log(`Investigating a player`);
|
||||
};
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
import { Socket } from 'socket.io';
|
||||
export const NextPresident = (socket: Socket, data: any) => {
|
||||
export const NextPresident = (socket: Socket, data: NextPresident) => {
|
||||
console.log(`Choosing the Next President`);
|
||||
};
|
||||
28
src/types/data.d.ts
vendored
28
src/types/data.d.ts
vendored
|
|
@ -1,3 +1,19 @@
|
|||
interface ExecutePlayer {}
|
||||
|
||||
interface InvestigateAffiliation {}
|
||||
|
||||
interface NextPresident {}
|
||||
|
||||
interface ExecutiveConfirmation {}
|
||||
|
||||
interface ChancellorNomination {}
|
||||
|
||||
interface ChancellorPolicy {}
|
||||
|
||||
interface GetPlayerList {
|
||||
game_code: string;
|
||||
}
|
||||
|
||||
interface HostGame {
|
||||
username: string;
|
||||
}
|
||||
|
|
@ -7,6 +23,12 @@ interface JoinGame {
|
|||
username: string;
|
||||
}
|
||||
|
||||
interface GetPlayerList {
|
||||
game_code: string;
|
||||
}
|
||||
interface PresidentPolicies {}
|
||||
|
||||
interface StartGame {}
|
||||
|
||||
interface VetoConfirm {}
|
||||
|
||||
interface VetoRequest {}
|
||||
|
||||
interface Vote {}
|
||||
Loading…
Add table
Add a link
Reference in a new issue