export type Suit = 'hearts' | 'diamonds' | 'clubs' | 'spades'; export interface Card { id: string; suit: Suit; rank: number; faceUp: boolean; } export type PileLocation = { type: 'tableau'; index: number; } | { type: 'foundation'; index: number; } | { type: 'waste'; } | { type: 'stock'; }; export interface GameState { stock: Card[]; waste: Card[]; foundations: Card[][]; tableaus: Card[][]; } /** How many cards a stock click turns over — XP sol.exe's Draw One / Draw Three. */ export type DrawMode = 1 | 3; /** XP standard scoring (sol.exe help): deltas per move type. */ export declare const SCORING: { readonly wasteToTableau: 5; readonly wasteToFoundation: 10; readonly tableauToFoundation: 10; readonly flipTableau: 5; readonly foundationToTableau: -15; /** Draw One: every pass through the stock after the first costs 100. */ readonly draw1Redeal: -100; /** Draw Three: every pass through the stock after the third costs 20. */ readonly draw3Redeal: -20; }; export declare const SUITS: Suit[]; export declare const RANK_LABELS: Record; export declare const SUIT_SYMBOLS: Record; export declare const isRed: (suit: Suit) => boolean; export declare const getTopCard: (pile: Card[]) => Card | null; export declare const createDeck: () => Card[]; export declare const shuffleDeck: (deck: Card[]) => Card[]; export declare const dealGame: () => GameState; export declare const canPlaceOnTableau: (cards: Card[], targetPile: Card[]) => boolean; export declare const canPlaceOnFoundation: (card: Card, foundation: Card[]) => boolean; export declare const checkWin: (foundations: Card[][]) => boolean; export declare const getMovableCards: (state: GameState, location: PileLocation) => { cards: Card[]; source: PileLocation; } | null; export declare const getCardAtPosition: (state: GameState, location: PileLocation, cardIndex?: number) => { cards: Card[]; source: PileLocation; } | null; export declare const applyMove: (state: GameState, cards: Card[], source: PileLocation, target: PileLocation) => GameState; export declare const dealFromStock: (state: GameState, drawCount?: DrawMode) => GameState; /** * Score delta for a move, per XP standard scoring. `state` is the pre-move * state — moving off a tableau pile whose newly exposed top card is face down * earns the +5 flip bonus (sol.exe awards it when the card turns over). */ export declare const scoreForMove: (state: GameState, cards: Card[], source: PileLocation, target: PileLocation) => number; /** The score never drops below zero in XP. */ export declare const applyScore: (score: number, delta: number) => number; /** * Penalty for recycling the waste back into the stock. `redealCount` is * 1-based (1 = first recycle). Draw One: the first pass through the stock is * free, every redeal costs 100. Draw Three: passes two and three are free, * every redeal from the third on costs 20. */ export declare const redealPenalty: (drawMode: DrawMode, redealCount: number) => number; export declare const cloneGameState: (state: GameState) => GameState; /** One-step undo snapshot: board plus the scoring counters. */ export interface GameSnapshot { state: GameState; score: number; redeals: number; } export declare const takeSnapshot: (state: GameState, score: number, redeals: number) => GameSnapshot;