@coledon/advanced-tictactoe
Version:
Advanced TicTacToe React component with AI opponents, animations, and multiple game modes. Perfect for 404 pages, hidden games, or entertainment features.
60 lines (58 loc) • 1.47 kB
TypeScript
import { default as React } from 'react';
import { Difficulty } from '../types/game';
interface TicTacToeGameProps {
/**
* Initial player name
* @default "Player"
*/
initialPlayerName?: string;
/**
* CSS class name for the game container
*/
className?: string;
/**
* Inline styles for the game container
*/
style?: React.CSSProperties;
/**
* Whether to show the full game interface with menu
* If false, will start directly in game mode
* @default true
*/
showMenu?: boolean;
/**
* Default AI difficulty when starting in game mode
* @default "medium"
*/
defaultDifficulty?: Difficulty;
/**
* Callback when game state changes
*/
onGameStateChange?: (state: 'menu' | 'game' | 'settings') => void;
}
/**
* Advanced TicTacToe Game Component
*
* A complete, ready-to-use TicTacToe game with AI opponents, animations,
* and persistent player statistics. Perfect for entertainment features,
* 404 pages, or hidden games in your application.
*
* @example
* ```tsx
* import { TicTacToeGame } from '@coledon/advanced-tictactoe';
*
* function App() {
* return (
* <div>
* <h1>My App</h1>
* <TicTacToeGame
* initialPlayerName="John"
* className="my-game-container"
* />
* </div>
* );
* }
* ```
*/
declare const TicTacToeGame: React.FC<TicTacToeGameProps>;
export default TicTacToeGame;