@@ -13,7 +13,13 @@ import type { TicTacToeGameState, RPSGameState, TicTacToeMove, RPSMove } from '.
1313 * Generic game mock factory
1414 * Creates a mock game instance with all required methods
1515 */
16- export function createGameMock ( ) {
16+ export function createGameMock ( ) : {
17+ getInitialState : ReturnType < typeof vi . fn > ;
18+ validateMove : ReturnType < typeof vi . fn > ;
19+ applyMove : ReturnType < typeof vi . fn > ;
20+ checkGameEnd : ReturnType < typeof vi . fn > ;
21+ getValidMoves : ReturnType < typeof vi . fn > ;
22+ } {
1723 return {
1824 getInitialState : vi . fn ( ) ,
1925 validateMove : vi . fn ( ) ,
@@ -95,7 +101,10 @@ export function createMockGameSession<T extends BaseGameState>(gameState: T, gam
95101 * Vitest mock configuration for shared package games
96102 * Use this to create consistent mocks across API route tests
97103 */
98- export function createSharedGameMocks ( gameClass : string ) {
104+ export function createSharedGameMocks ( gameClass : string ) : {
105+ mockImplementation : any ;
106+ mockGame : ReturnType < typeof createGameMock > ;
107+ } {
99108 const mockGame = createGameMock ( )
100109
101110 return {
@@ -110,7 +119,7 @@ export function createSharedGameMocks(gameClass: string) {
110119/**
111120 * Create storage function mocks for a specific game type
112121 */
113- export function createStorageMocks ( gameType : GameType ) {
122+ export function createStorageMocks ( gameType : GameType ) : Record < string , ReturnType < typeof vi . fn > > {
114123 if ( gameType === 'tic-tac-toe' ) {
115124 return {
116125 getTicTacToeGame : vi . fn ( ) ,
0 commit comments