From edeee0093be7a18473c2a336e5066ed22eac6fba Mon Sep 17 00:00:00 2001 From: apetitco Date: Sat, 20 Dec 2025 01:04:37 +0100 Subject: [PATCH] (tic-tac-toe): Laid the foundations for tic tac toe/database interactions --- src/@shared/src/database/mixin/tictactoe.ts | 2 +- src/tic-tac-toe/src/app.ts | 1 + src/tic-tac-toe/src/game.ts | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/@shared/src/database/mixin/tictactoe.ts b/src/@shared/src/database/mixin/tictactoe.ts index 4d4cda8..5cb3e7d 100644 --- a/src/@shared/src/database/mixin/tictactoe.ts +++ b/src/@shared/src/database/mixin/tictactoe.ts @@ -33,7 +33,7 @@ export const TicTacToeImpl: Omit = { export type TicTacToeId = number & { readonly __brand: unique symbol }; -export type TemplateData = { +export type TicTacToeData = { readonly id: TicTacToeId; readonly player1: string; readonly player2: string; diff --git a/src/tic-tac-toe/src/app.ts b/src/tic-tac-toe/src/app.ts index ba8b753..7238b0b 100644 --- a/src/tic-tac-toe/src/app.ts +++ b/src/tic-tac-toe/src/app.ts @@ -7,6 +7,7 @@ import * as auth from '@shared/auth'; import * as swagger from '@shared/swagger'; import * as utils from '@shared/utils'; import { Server } from 'socket.io'; +import type { TicTacToeData } from '@shared/database/mixin/tictactoe'; declare const __SERVICE_NAME: string; diff --git a/src/tic-tac-toe/src/game.ts b/src/tic-tac-toe/src/game.ts index c472e50..0d929ad 100644 --- a/src/tic-tac-toe/src/game.ts +++ b/src/tic-tac-toe/src/game.ts @@ -1,3 +1,5 @@ +import type { TicTacToeData } from '@shared/database/mixin/tictactoe'; + // Represents the possible states of a cell on the board. // `null` means that the cell is empty. type CellState = 'O' | 'X' | null