/**
 * Compile-time drift guards. Nothing here runs: `pnpm --filter @pintrush/protocol typecheck` fails if a
 * schema stops matching the engine type it mirrors (added, removed, renamed or retyped field, changed
 * optionality or nullability). Exported only so `noUnusedLocals` can never flag them; not re-exported
 * from the package index.
 */
import type {
  BoardState,
  CategoryDef,
  CompletedRoundSummary,
  Difficulty,
  ErrorCode,
  EventMode,
  HostState,
  PlayerStatus,
  PlayerTotals,
  PowerUpType,
  PrivateState,
  PublicState,
  QuestionResult,
  QuestionType,
  RoundKind,
  RoundPhase,
  SessionStatus,
  Standing,
  TeamStanding,
  TileSource,
  TileState,
} from '@pintrush/engine';
import type { ENGINE_ERROR_CODES } from './acks';
import type {
  DIFFICULTIES,
  EVENT_MODES,
  PLAYER_STATUSES,
  POWER_UP_TYPES,
  QUESTION_TYPES,
  ROUND_KINDS,
  ROUND_PHASES,
  SESSION_STATUSES,
  TILE_SOURCES,
} from './common';
import type { Equal, Expect, SchemaMatches } from './type-utils';
import type {
  BoardStateSchema,
  CategoryDefSchema,
  CompletedRoundSummarySchema,
  HostStateSchema,
  PlayerTotalsSchema,
  PrivateStateSchema,
  PublicStateSchema,
  QuestionResultSchema,
  StandingSchema,
  TeamStandingSchema,
  TileStateSchema,
} from './views';

export type EnumAlignment = [
  Expect<Equal<(typeof EVENT_MODES)[number], EventMode>>,
  Expect<Equal<(typeof SESSION_STATUSES)[number], SessionStatus>>,
  Expect<Equal<(typeof ROUND_KINDS)[number], RoundKind>>,
  Expect<Equal<(typeof DIFFICULTIES)[number], Difficulty>>,
  Expect<Equal<(typeof QUESTION_TYPES)[number], QuestionType>>,
  Expect<Equal<(typeof POWER_UP_TYPES)[number], PowerUpType>>,
  Expect<Equal<(typeof PLAYER_STATUSES)[number], PlayerStatus>>,
  Expect<Equal<(typeof TILE_SOURCES)[number], TileSource>>,
  Expect<Equal<(typeof ROUND_PHASES)[number], RoundPhase>>,
  Expect<Equal<(typeof ENGINE_ERROR_CODES)[number], ErrorCode>>,
];

export type ViewAlignment = [
  Expect<SchemaMatches<typeof CategoryDefSchema, CategoryDef>>,
  Expect<SchemaMatches<typeof PlayerTotalsSchema, PlayerTotals>>,
  Expect<SchemaMatches<typeof TileStateSchema, TileState>>,
  Expect<SchemaMatches<typeof BoardStateSchema, BoardState>>,
  Expect<SchemaMatches<typeof QuestionResultSchema, QuestionResult>>,
  Expect<SchemaMatches<typeof CompletedRoundSummarySchema, CompletedRoundSummary>>,
  Expect<SchemaMatches<typeof StandingSchema, Standing>>,
  Expect<SchemaMatches<typeof TeamStandingSchema, TeamStanding>>,
  Expect<SchemaMatches<typeof PublicStateSchema, PublicState>>,
  Expect<SchemaMatches<typeof PrivateStateSchema, PrivateState>>,
  Expect<SchemaMatches<typeof HostStateSchema, HostState>>,
];
