Convert from the symlink format to a local package
This commit is contained in:
parent
4c957cce07
commit
c2dfd2fd3a
8 changed files with 104 additions and 12 deletions
7
common/src/enums/Status.ts
Normal file
7
common/src/enums/Status.ts
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
export enum Status {
|
||||
Success = 200,
|
||||
UnknownError = 400,
|
||||
OutOfDate = 401,
|
||||
NotFound = 404,
|
||||
Teapot = 418,
|
||||
}
|
||||
4
common/src/index.ts
Normal file
4
common/src/index.ts
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
export { Status } from "./enums/Status";
|
||||
export { Colour } from "./types/Colour";
|
||||
export * from "./types/events/SaveShip";
|
||||
export * from "./types/ServerResponse";
|
||||
4
common/src/types/Colour.ts
Normal file
4
common/src/types/Colour.ts
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
export interface Colour {
|
||||
name: string;
|
||||
hex: string;
|
||||
}
|
||||
8
common/src/types/ServerResponse.ts
Normal file
8
common/src/types/ServerResponse.ts
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
export interface ServerResponse {
|
||||
|
||||
/** The state indicator for responses from the server */
|
||||
status: number;
|
||||
|
||||
/** Additional information that is provided by the server */
|
||||
message?: string;
|
||||
}
|
||||
20
common/src/types/events/SaveShip.ts
Normal file
20
common/src/types/events/SaveShip.ts
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
import { ServerResponse } from "../ServerResponse";
|
||||
|
||||
/** The data the client must provide in the `SaveShip` event. */
|
||||
export interface SaveShip {
|
||||
colour: string;
|
||||
ship: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* The event that get's sent out to all the other players on a successful
|
||||
* `SaveShip` event
|
||||
*/
|
||||
export interface DesignUpdate {
|
||||
player: string;
|
||||
ship: string;
|
||||
colour: string;
|
||||
}
|
||||
|
||||
/** The response to the client that triggered the `SaveShip` event. */
|
||||
export interface SaveShipResponse extends ServerResponse {}
|
||||
Loading…
Add table
Add a link
Reference in a new issue