All files / web/src/lib/arcade/matching-pairs-framework index.ts

100% Statements 70/70
100% Branches 0/0
100% Functions 0/0
100% Lines 70/70

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 711x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x  
/**
 * Matching Pairs Framework
 *
 * A factory for building matching-pairs games with just a thin variant definition.
 * See MatchingPairsVariant for the extension interface.
 *
 * @example
 * ```typescript
 * import { defineMatchingPairsGame } from '@/lib/arcade/matching-pairs-framework'
 *
 * const { game, useMatchingPairs } = defineMatchingPairsGame({
 *   manifest: { ... },
 *   variant: {
 *     gameName: 'music-notes',
 *     defaultConfig: { difficulty: 6, turnTimer: 30, instrument: 'piano' },
 *     generateCards: (config) => [...],
 *     validateMatch: (card1, card2) => ({ isValid: card1.note === card2.note, type: 'note' }),
 *     CardFront: ({ card }) => <NoteDisplay note={card.note} />,
 *     // ... other variant methods
 *   },
 * })
 * ```
 */
 
// Top-level factory
export { defineMatchingPairsGame } from './define-matching-pairs-game'
export type { DefineMatchingPairsGameOptions } from './define-matching-pairs-game'
 
// Validator factory
export { createMatchingPairsValidator } from './create-validator'
 
// Provider factory
export { createMatchingPairsProvider } from './create-provider'
 
// Generic components
export { FlipCard } from './components/FlipCard'
export type { FlipCardProps } from './components/FlipCard'
export { GenericSetupPhase } from './components/GenericSetupPhase'
export type { GenericSetupPhaseProps } from './components/GenericSetupPhase'
export { GenericGamePhase } from './components/GenericGamePhase'
export type { GenericGamePhaseProps } from './components/GenericGamePhase'
export {
  GenericResultsPhase,
  formatGameTime,
  getPerformanceAnalysis,
} from './components/GenericResultsPhase'
export type { GenericResultsPhaseProps } from './components/GenericResultsPhase'
export { createMatchingPairsGameComponent } from './components/GenericGameComponent'
 
// Types
export type {
  BaseMatchingCard,
  BaseMatchingConfig,
  CardBackStyle,
  Difficulty,
  GameMode,
  GamePhase,
  GameStatistics,
  MatchingPairsContextValue,
  MatchingPairsGameBundle,
  MatchingPairsMove,
  MatchingPairsState,
  MatchingPairsVariant,
  MatchValidationResult,
  NavInfo,
  PausedGameState,
  Player,
  PlayerMetadata,
  SetupContentProps,
} from './types'