- Add player_positions JSONB column to roster_links (migration 006) - Add player_data JSONB column to cache name/image/headshot (migration 007) - Add is_pitcher/is_batter computed properties for two-way player support - Update lineup submission to populate RosterLink with all players + positions - Update get_bench handler to use cached data (no runtime API calls) - Add BenchPlayer type to frontend with proper filtering - Add new Lineup components: InlineSubstitutionPanel, LineupSlotRow, PositionSelector, UnifiedLineupTab - Add integration tests for get_bench_players Bench players now load instantly without API dependency, and properly filter batters vs pitchers (including CP closer position). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
122 lines
2.3 KiB
TypeScript
122 lines
2.3 KiB
TypeScript
/**
|
|
* Type Definitions Index
|
|
*
|
|
* Central export point for all TypeScript types.
|
|
* Import types from this file throughout the application.
|
|
*
|
|
* @example
|
|
* import type { GameState, SbaPlayer, TypedSocket } from '~/types'
|
|
*/
|
|
|
|
// Game types
|
|
export type {
|
|
GameStatus,
|
|
InningHalf,
|
|
GameMode,
|
|
GameVisibility,
|
|
LeagueId,
|
|
DecisionPhase,
|
|
LineupPlayerState,
|
|
GameState,
|
|
DefensiveDecision,
|
|
OffensiveDecision,
|
|
RollData,
|
|
PlayOutcome,
|
|
RunnerAdvancement,
|
|
PlayResult,
|
|
XCheckResult,
|
|
DecisionPrompt,
|
|
ManualOutcomeSubmission,
|
|
GameListItem,
|
|
CreateGameRequest,
|
|
CreateGameResponse,
|
|
} from './game'
|
|
|
|
// Player types
|
|
export type {
|
|
SbaPlayer,
|
|
Lineup,
|
|
TeamLineup,
|
|
BenchPlayer,
|
|
LineupDataResponse,
|
|
SubstitutionType,
|
|
SubstitutionRequest,
|
|
SubstitutionResult,
|
|
SubstitutionErrorCode,
|
|
SubstitutionError,
|
|
} from './player'
|
|
|
|
// WebSocket types
|
|
export type {
|
|
SocketAuth,
|
|
ClientToServerEvents,
|
|
ServerToClientEvents,
|
|
TypedSocket,
|
|
// Request types
|
|
JoinGameRequest,
|
|
LeaveGameRequest,
|
|
DefensiveDecisionRequest,
|
|
OffensiveDecisionRequest,
|
|
RollDiceRequest,
|
|
SubmitManualOutcomeRequest,
|
|
PinchHitterRequest,
|
|
DefensiveReplacementRequest,
|
|
PitchingChangeRequest,
|
|
GetLineupRequest,
|
|
GetBoxScoreRequest,
|
|
RequestGameStateRequest,
|
|
// Event types
|
|
ConnectedEvent,
|
|
GameJoinedEvent,
|
|
UserConnectedEvent,
|
|
UserDisconnectedEvent,
|
|
DefensiveDecisionSubmittedEvent,
|
|
OffensiveDecisionSubmittedEvent,
|
|
DiceRolledEvent,
|
|
OutcomeAcceptedEvent,
|
|
InningChangeEvent,
|
|
GameEndedEvent,
|
|
SubstitutionConfirmedEvent,
|
|
BoxScoreDataEvent,
|
|
BattingStatLine,
|
|
PitchingStatLine,
|
|
GameStateSyncEvent,
|
|
ErrorEvent,
|
|
OutcomeRejectedEvent,
|
|
InvalidActionEvent,
|
|
ConnectionErrorEvent,
|
|
} from './websocket'
|
|
|
|
// API types
|
|
export type {
|
|
ApiError,
|
|
PaginatedResponse,
|
|
GameFilters,
|
|
DiscordAuthResponse,
|
|
DiscordUser,
|
|
JwtPayload,
|
|
Team,
|
|
UserTeamsResponse,
|
|
CreateGameRequestData,
|
|
CreateGameResponseData,
|
|
GetGameResponse,
|
|
GetActiveGamesResponse,
|
|
GetCompletedGamesResponse,
|
|
PlayHistoryItem,
|
|
GetPlayHistoryResponse,
|
|
DeleteGameResponse,
|
|
DiscordCallbackRequest,
|
|
DiscordCallbackResponse,
|
|
GetCurrentUserResponse,
|
|
RefreshTokenRequest,
|
|
RefreshTokenResponse,
|
|
} from './api'
|
|
|
|
// Schedule types
|
|
export type {
|
|
SbaCurrent,
|
|
SbaScheduledGame,
|
|
GetCurrentResponse,
|
|
GetScheduleGamesResponse,
|
|
} from './schedule'
|