(tic-tac-toe): Laid the foundations for tic tac toe/database interactions

This commit is contained in:
apetitco 2025-12-20 01:04:37 +01:00
parent f5c0f5635d
commit edeee0093b
3 changed files with 4 additions and 1 deletions

View file

@ -33,7 +33,7 @@ export const TicTacToeImpl: Omit<ITicTacToeDb, keyof Database> = {
export type TicTacToeId = number & { readonly __brand: unique symbol }; export type TicTacToeId = number & { readonly __brand: unique symbol };
export type TemplateData = { export type TicTacToeData = {
readonly id: TicTacToeId; readonly id: TicTacToeId;
readonly player1: string; readonly player1: string;
readonly player2: string; readonly player2: string;

View file

@ -7,6 +7,7 @@ import * as auth from '@shared/auth';
import * as swagger from '@shared/swagger'; import * as swagger from '@shared/swagger';
import * as utils from '@shared/utils'; import * as utils from '@shared/utils';
import { Server } from 'socket.io'; import { Server } from 'socket.io';
import type { TicTacToeData } from '@shared/database/mixin/tictactoe';
declare const __SERVICE_NAME: string; declare const __SERVICE_NAME: string;

View file

@ -1,3 +1,5 @@
import type { TicTacToeData } from '@shared/database/mixin/tictactoe';
// Represents the possible states of a cell on the board. // Represents the possible states of a cell on the board.
// `null` means that the cell is empty. // `null` means that the cell is empty.
type CellState = 'O' | 'X' | null type CellState = 'O' | 'X' | null