@sensiblestats/widget-sdk 0.65.0 → 0.67.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -100,6 +100,10 @@ interface GreetingDashboardTile {
100
100
  signal: GreetingDashboardSignalRef;
101
101
  /** "hero": the personalized lead tile (always full width). Older servers omit it. */
102
102
  emphasis?: GreetingDashboardTileEmphasis | null;
103
+ /** Hero top-row line ("Tip-off 02:30 · in 6 h"); shown only when the hero has no price. Older servers omit it. */
104
+ meta?: string | null;
105
+ /** Short text marks (team abbreviations) drawn as circles when imageUrls is empty. Older servers omit it. */
106
+ imageCodes?: string[] | null;
103
107
  }
104
108
  interface GreetingDashboard {
105
109
  layout: GreetingDashboardLayout;
@@ -697,6 +701,162 @@ interface NbaInsight {
697
701
  interface NbaInsightEventData {
698
702
  insight: NbaInsight;
699
703
  }
704
+ type NflInsightKind = 'settle_recap' | 'prop_reason' | 'ladder' | 'injury_report' | 'line_move' | 'ats_record' | 'matchup';
705
+ interface NflInsightSelection {
706
+ key: string;
707
+ marketDeveloperName: string;
708
+ selectionLabel: string;
709
+ side: string;
710
+ line?: string | null;
711
+ price: number;
712
+ quotedAtUtc: string;
713
+ }
714
+ interface NflPropReasonGame {
715
+ week: number;
716
+ opponent: string;
717
+ value?: number | null;
718
+ result?: string | null;
719
+ }
720
+ interface NflPropReasonEvidence {
721
+ playerId: number;
722
+ playerName: string;
723
+ propType: string;
724
+ line: string;
725
+ hits: number;
726
+ misses: number;
727
+ pushes: number;
728
+ n: number;
729
+ games: NflPropReasonGame[];
730
+ }
731
+ interface NflLadderRung {
732
+ at: string;
733
+ hits: number;
734
+ selectionKey: string;
735
+ }
736
+ interface NflLadderEvidence {
737
+ playerId: number;
738
+ playerName: string;
739
+ propType: string;
740
+ n: number;
741
+ rungs: NflLadderRung[];
742
+ }
743
+ interface NflInjuryPlayer {
744
+ name: string;
745
+ position?: string | null;
746
+ status: string;
747
+ }
748
+ interface NflInjuryReportEvidence {
749
+ teamId: number;
750
+ teamName: string;
751
+ teamAbbr: string;
752
+ opponentAbbr: string;
753
+ players: NflInjuryPlayer[];
754
+ morePlayers: number;
755
+ }
756
+ interface NflLineMoveLane {
757
+ market: string;
758
+ side: string;
759
+ openLine?: string | null;
760
+ openPrice: number;
761
+ openAt: string;
762
+ line?: string | null;
763
+ price: number;
764
+ quotedAtUtc: string;
765
+ }
766
+ interface NflLineMoveEvidence {
767
+ lanes: NflLineMoveLane[];
768
+ }
769
+ interface NflAtsGame {
770
+ week: number;
771
+ opponentAbbr: string;
772
+ spreadLine: string;
773
+ result: string;
774
+ }
775
+ interface NflAtsRecordEvidence {
776
+ teamId: number;
777
+ teamName: string;
778
+ teamAbbr: string;
779
+ finishedGames: number;
780
+ n: number;
781
+ w: number;
782
+ l: number;
783
+ p: number;
784
+ withoutOpening: number;
785
+ games: NflAtsGame[];
786
+ }
787
+ interface NflMatchupEvidence {
788
+ defenseTeamName: string;
789
+ defenseAbbr: string;
790
+ offenseTeamName: string;
791
+ offenseAbbr: string;
792
+ position: string;
793
+ basis: string;
794
+ yardsPerGame: number;
795
+ touchdownsPerGame: number;
796
+ rank: number;
797
+ rankedTeams: number;
798
+ n: number;
799
+ }
800
+ interface NflSettleRecapLine {
801
+ propType: string;
802
+ line?: string | null;
803
+ actual?: number | null;
804
+ result: string;
805
+ }
806
+ interface NflSettleRecapPlayer {
807
+ playerId: number;
808
+ name: string;
809
+ lines: NflSettleRecapLine[];
810
+ }
811
+ interface NflSettleRecapSummary {
812
+ over: number;
813
+ under: number;
814
+ pushes: number;
815
+ yes: number;
816
+ no: number;
817
+ voids: number;
818
+ n: number;
819
+ }
820
+ interface NflSettleRecapEvidence {
821
+ finalScore: string;
822
+ lineBasis: string;
823
+ players: NflSettleRecapPlayer[];
824
+ morePlayers: number;
825
+ summary: NflSettleRecapSummary;
826
+ }
827
+ interface NflInsight {
828
+ insightId: string;
829
+ matchId: number;
830
+ kind: string;
831
+ text: string;
832
+ title: string;
833
+ marketDeveloperName?: string | null;
834
+ marketLabel?: string | null;
835
+ selections: NflInsightSelection[];
836
+ disclaimer?: string | null;
837
+ homeTeamName: string;
838
+ awayTeamName: string;
839
+ homeTeamAbbr: string;
840
+ awayTeamAbbr: string;
841
+ competitionName: string;
842
+ addToSlipEnabled: boolean;
843
+ pinEnabled: boolean;
844
+ kickoffUtc?: string | null;
845
+ kickoffLabel?: string | null;
846
+ quotedAtUtc?: string | null;
847
+ sport: string;
848
+ propReason?: NflPropReasonEvidence | null;
849
+ ladder?: NflLadderEvidence | null;
850
+ injuryReport?: NflInjuryReportEvidence | null;
851
+ lineMove?: NflLineMoveEvidence | null;
852
+ atsRecord?: NflAtsRecordEvidence | null;
853
+ matchup?: NflMatchupEvidence | null;
854
+ settleRecap?: NflSettleRecapEvidence | null;
855
+ [key: string]: unknown;
856
+ }
857
+ interface NflInsightEventData {
858
+ insight: NflInsight;
859
+ }
700
860
  interface MarketOddsRow {
701
861
  selectionLabel: string;
702
862
  side?: string | null;
@@ -734,8 +894,11 @@ interface MarketOddsCard {
734
894
  competitionImagePath?: string | null;
735
895
  /** Server-rendered kickoff chip in the operator's zone + language. Prefer over local formatting of kickoffUtc. */
736
896
  kickoffLabel?: string | null;
737
- /** `basketball` on an NBA game card; absent or null reads as football. */
897
+ /** `basketball` on an NBA game card, `americanfootball` on an NFL one; absent or null reads as football. */
738
898
  sport?: string | null;
899
+ /** Short team names (NFL), drawn as the badge in place of a crest. */
900
+ homeTeamAbbr?: string | null;
901
+ awayTeamAbbr?: string | null;
739
902
  /** The strongest stat for this card's market and fixture, already in the turn's language. */
740
903
  insight?: MarketOddsCardInsight | null;
741
904
  /** Up to 2 stats for this card's exact market, strongest first; insights[0] is always the same
@@ -1158,7 +1321,7 @@ interface EventEnvelope<TType extends string, TData> {
1158
1321
  timestamp: string;
1159
1322
  data: TData;
1160
1323
  }
1161
- type ChatEvent = EventEnvelope<'progress', ProgressEventData> | EventEnvelope<'answer', AnswerEventData> | EventEnvelope<'entity_card', EntityCardEventData> | EventEnvelope<'action_button', ActionButtonEventData> | EventEnvelope<'intent_chip', IntentChipEventData> | EventEnvelope<'actions_loading', ActionsLoadingEventData> | EventEnvelope<'turn_complete', TurnCompleteEventData> | EventEnvelope<'betting_insight', BettingInsightEventData> | EventEnvelope<'nba_insight', NbaInsightEventData> | EventEnvelope<'market_odds', MarketOddsEventData> | EventEnvelope<'combo_card', ComboCardEventData> | EventEnvelope<'odds_movement', OddsMovementEventData> | EventEnvelope<'error', StreamErrorEventData>;
1324
+ type ChatEvent = EventEnvelope<'progress', ProgressEventData> | EventEnvelope<'answer', AnswerEventData> | EventEnvelope<'entity_card', EntityCardEventData> | EventEnvelope<'action_button', ActionButtonEventData> | EventEnvelope<'intent_chip', IntentChipEventData> | EventEnvelope<'actions_loading', ActionsLoadingEventData> | EventEnvelope<'turn_complete', TurnCompleteEventData> | EventEnvelope<'betting_insight', BettingInsightEventData> | EventEnvelope<'nba_insight', NbaInsightEventData> | EventEnvelope<'nfl_insight', NflInsightEventData> | EventEnvelope<'market_odds', MarketOddsEventData> | EventEnvelope<'combo_card', ComboCardEventData> | EventEnvelope<'odds_movement', OddsMovementEventData> | EventEnvelope<'error', StreamErrorEventData>;
1162
1325
  interface GameSummary {
1163
1326
  gameId: string;
1164
1327
  gameDay: string;
@@ -1380,6 +1543,38 @@ interface ClubRecordsPayload {
1380
1543
  sinceSeasonName: string | null;
1381
1544
  }
1382
1545
 
1546
+ interface SportSpec {
1547
+ readonly slipPrefix: string;
1548
+ readonly monitorPrefix: string;
1549
+ readonly label: string;
1550
+ readonly slippable: boolean;
1551
+ }
1552
+ declare const SPORTS: {
1553
+ readonly basketball: {
1554
+ readonly slipPrefix: "bb:";
1555
+ readonly monitorPrefix: "nba:";
1556
+ readonly label: "NBA";
1557
+ readonly slippable: true;
1558
+ };
1559
+ readonly americanfootball: {
1560
+ readonly slipPrefix: "af:";
1561
+ readonly monitorPrefix: "nfl:";
1562
+ readonly label: "NFL";
1563
+ readonly slippable: false;
1564
+ };
1565
+ };
1566
+ type NonFootballSport = keyof typeof SPORTS;
1567
+ /** The sports whose prices can reach an operator slip or a pin: those the map marks slippable. */
1568
+ type SlipSport = {
1569
+ [K in NonFootballSport]: (typeof SPORTS)[K]['slippable'] extends true ? K : never;
1570
+ }[NonFootballSport];
1571
+ /** undefined means football: every sport the map does not know is football. */
1572
+ declare function sportOf(v: unknown): NonFootballSport | undefined;
1573
+ /** True for football (no sport) and for a sport the map marks slippable: the only cases that may pin or slip. */
1574
+ declare function mayPinOrSlip(v: unknown): boolean;
1575
+ /** The sport when it may take a slip pick or a pin; undefined for football and for a sport that never does. */
1576
+ declare function slipSportOf(v: unknown): SlipSport | undefined;
1577
+
1383
1578
  type FetchLike = (input: string, init: RequestInit) => Promise<Response>;
1384
1579
  interface StatsWidgetClientOptions {
1385
1580
  operatorId: string;
@@ -1404,6 +1599,14 @@ interface ChatGrounding {
1404
1599
  season?: string;
1405
1600
  subject?: string;
1406
1601
  personaHint?: string;
1602
+ sport?: string;
1603
+ }
1604
+ /** The page the widget sits on. Sent on greeting requests only, so the greeting can lead with that page. */
1605
+ interface PageContext {
1606
+ sport: 'football' | 'nba';
1607
+ kind?: 'section' | 'competition' | 'match';
1608
+ matchId?: string | number;
1609
+ competitionId?: string | number;
1407
1610
  }
1408
1611
  /** Onboarding presets stage 2 (contract §3): what a tool's Send asked for. Sent only from a tool's
1409
1612
  * Send, beside the full sentence in `message`. The server ignores it unless every value is valid. */
@@ -1437,6 +1640,7 @@ interface ChatInput {
1437
1640
  clientCapabilities?: string[];
1438
1641
  /** Onboarding presets stage 2: set only by a preset tool's Send (contract §3). */
1439
1642
  preset?: ChatPreset;
1643
+ page?: PageContext;
1440
1644
  }
1441
1645
  type SignalType = 'MatchPageView' | 'PlayerPageView' | 'TeamPageView' | 'MarketView' | 'SearchQuery' | 'SessionDepth' | 'TimeOnPage' | 'InsightViewed' | 'InsightMarketClicked' | 'BetPlacedFromInsight' | 'InsightScrollDepth' | 'ToolCall' | 'EntityMention' | 'Handoff' | 'FollowUpQuery' | 'RecommendationDismissed';
1442
1646
  type SignalEntityType = 'Match' | 'Team' | 'Player' | 'Competition' | 'Market' | 'Article' | 'Session' | 'Query' | 'Conversation';
@@ -1454,7 +1658,7 @@ interface SignalInput {
1454
1658
  /** Zero-based tile position within the dashboard, when it is a dashboard tap. */
1455
1659
  tileIndex?: number;
1456
1660
  }
1457
- type SlipSport = 'basketball';
1661
+
1458
1662
  interface SlipSelection {
1459
1663
  matchOddsId: number;
1460
1664
  matchId: number;
@@ -1654,4 +1858,4 @@ interface NdjsonParser {
1654
1858
  }
1655
1859
  declare function createNdjsonParser(): NdjsonParser;
1656
1860
 
1657
- export { type ActionButtonEventData, type ActionsLoadingEventData, type AddToSlipHandler, type AddToSlipRejectReason, type AddToSlipResult, type AllTimeRow, type AnswerEventData, AuthError, type AvailableMarket, type BettingInsight, type BettingInsightEventData, type BettingInsightOdds, type ChatCallbacks, type ChatEvent, type ChatGrounding, type ChatHandle, type ChatInput, type ChatPreset, type ClubFanDashboardCard, type ClubFanDashboardHeadToHead, type ClubFanDashboardPayload, type ClubFixture, type ClubFixturesPayload, type ClubMatchLogRow, type ClubNextFixture, type ClubPerformanceMetric, type ClubPlayerAvailability, type ClubPlayerAvailabilityStatus, type ClubPlayerDetailPayload, type ClubPlayerPerformance, type ClubPlayerSeasonStats, type ClubRecordEntry, type ClubRecordsPayload, type ClubSquadPayload, type ClubSquadPlayer, type ClubSquadStatsPayload, type ClubStandingRow, type ClubStandingsPayload, type ComboCard, type ComboCardEventData, type ComboLeg, type ComboReplacedLeg, type CongestedWeekCard, type CongestedWeekData, type CongestedWeekEntry, Conversation, type CountdownCard, type CountdownData, ENTITY_TYPE_CODES, type EntityCard, type EntityCardEventData, type EntityCardScope, type EntityCardStat, type EventBatch, type EventLogger, type EventLoggerOptions, type FetchLike, type FixtureCard, type FixtureCardData, ForbiddenError, type FormAndH2H, type FormMatch, type GameListPayload, type GameResultPayload, type GameStatePayload, type GameSummary, type GreetingDashboard, type GreetingDashboardLayout, type GreetingDashboardSignalRef, type GreetingDashboardSpan, type GreetingDashboardTile, type GreetingDashboardTileEmphasis, type HeadToHead, type InjuriesCard, type InjuriesCardData, type InjuryRow, type IntentChipEventData, LIMIT_CODES, type LeaderboardChampion, type LeaderboardPayload, type LeaderboardRow, type LeagueStarResult, type LimitCode, type LimitDetails, LimitError, type LinkRow, type LinksCard, type LinksData, type LiveEventLine, type LiveMonitorBasketball, type LiveMonitorEvent, type LiveMonitorFact, type LiveMonitorMarket, type LiveMonitorMatch, type LiveMonitorSnapshot, type LiveMonitorStatPrice, type LiveMonitorStatRow, type LiveScoreCard, type LiveScoreData, type LiveStatRow, type LiveStatsCard, type LiveStatsData, type LiveTimelineCard, type LiveTimelineData, type MarketOddsBlock, type MarketOddsCard, type MarketOddsCardInsight, type MarketOddsEventData, type MarketOddsLiveBlock, type MarketOddsRow, type MatchState, type MomentumPoint, type MonitorPhase, type MonitorSport, type NbaCoHitEvidence, type NbaCoHitLeg, type NbaGameValue, type NbaInjuryEvent, type NbaInsight, type NbaInsightEventData, type NbaInsightSelection, type NbaJointGame, type NbaLadderEvidence, type NbaLadderRung, type NbaLadderStat, type NbaLineLane, type NbaLineMoveEvidence, type NbaLinePoint, type NbaListedTeammate, type NbaMatchupEvidence, type NbaMatchupPosition, type NbaMatchupTeam, type NbaPropReasonEvidence, type NbaQuarterLadderEvidence, type NbaQuarterRung, type NbaQuarterStat, type NbaSettleLine, type NbaSettlePlayer, type NbaSettleRecapEvidence, type NbaSettleSummary, type NbaSplitRow, type NbaTeammateOutEvidence, type NdjsonParser, NetworkError, type OddsMovementCard, type OddsMovementEventData, type OddsMovementPoint, ParseError, type PinKind, type PinRef, type PlayerPropGame, type PlayerPropPrice, type PlayerPropStat, type PlayerPropsBundle, type PostMatchGoalLine, type PostMatchGoalsCard, type PostMatchGoalsData, type PostMatchNextCard, type PostMatchNextData, type PostMatchResultCard, type PostMatchResultData, type PostMatchStatRow, type PostMatchStatsCard, type PostMatchStatsData, type PostMatchTopPerformerCard, type PostMatchTopPerformerData, type PresetComboCell, type PresetGrid, type PresetGridOptions, type PresetMarketCell, type PresetPick, type PresetSinglesCell, type ProgressEventData, RateLimitError, type ReasonToBetCard, type ReasonToBetData, type RestingFormCard, type RestingFormData, type RestingNextCard, type RestingNextData, type RestingSeasonCard, type RestingSeasonData, type RestingStandingsCard, type RestingStandingsData, SIGNAL_TYPE_CODES, type ScheduleGroup, type ScheduleMatch, type SchedulePayload, type ScheduleSport, type SignalEntityType, type SignalInput, type SignalType, type SlipSelection, type SlipSport, type StatesPayload, StatsWidgetClient, type StatsWidgetClientOptions, type StreamErrorEventData, type SubmitPlayBody, type SubmitPlayResult, type TransferRow, type TransfersCard, type TransfersData, type TurnCompleteEventData, UpstreamError, type UserContext, type WhereToWatchCard, type WhereToWatchData, type WidgetEntityEventName, type WidgetEntityType, type WidgetEventInput, type WidgetEventName, type WidgetLogInput, type WidgetOpenEventInput, type WidgetOpenEventName, type WidgetPopupAskEventInput, type WidgetPopupAskEventName, type WidgetPopupEventInput, type WidgetPopupEventName, WidgetSdkError, type WireEvent, createEventLogger, createNdjsonParser, isAddToSlipResult, isLimitCode, matchKey };
1861
+ export { type ActionButtonEventData, type ActionsLoadingEventData, type AddToSlipHandler, type AddToSlipRejectReason, type AddToSlipResult, type AllTimeRow, type AnswerEventData, AuthError, type AvailableMarket, type BettingInsight, type BettingInsightEventData, type BettingInsightOdds, type ChatCallbacks, type ChatEvent, type ChatGrounding, type ChatHandle, type ChatInput, type ChatPreset, type ClubFanDashboardCard, type ClubFanDashboardHeadToHead, type ClubFanDashboardPayload, type ClubFixture, type ClubFixturesPayload, type ClubMatchLogRow, type ClubNextFixture, type ClubPerformanceMetric, type ClubPlayerAvailability, type ClubPlayerAvailabilityStatus, type ClubPlayerDetailPayload, type ClubPlayerPerformance, type ClubPlayerSeasonStats, type ClubRecordEntry, type ClubRecordsPayload, type ClubSquadPayload, type ClubSquadPlayer, type ClubSquadStatsPayload, type ClubStandingRow, type ClubStandingsPayload, type ComboCard, type ComboCardEventData, type ComboLeg, type ComboReplacedLeg, type CongestedWeekCard, type CongestedWeekData, type CongestedWeekEntry, Conversation, type CountdownCard, type CountdownData, ENTITY_TYPE_CODES, type EntityCard, type EntityCardEventData, type EntityCardScope, type EntityCardStat, type EventBatch, type EventLogger, type EventLoggerOptions, type FetchLike, type FixtureCard, type FixtureCardData, ForbiddenError, type FormAndH2H, type FormMatch, type GameListPayload, type GameResultPayload, type GameStatePayload, type GameSummary, type GreetingDashboard, type GreetingDashboardLayout, type GreetingDashboardSignalRef, type GreetingDashboardSpan, type GreetingDashboardTile, type GreetingDashboardTileEmphasis, type HeadToHead, type InjuriesCard, type InjuriesCardData, type InjuryRow, type IntentChipEventData, LIMIT_CODES, type LeaderboardChampion, type LeaderboardPayload, type LeaderboardRow, type LeagueStarResult, type LimitCode, type LimitDetails, LimitError, type LinkRow, type LinksCard, type LinksData, type LiveEventLine, type LiveMonitorBasketball, type LiveMonitorEvent, type LiveMonitorFact, type LiveMonitorMarket, type LiveMonitorMatch, type LiveMonitorSnapshot, type LiveMonitorStatPrice, type LiveMonitorStatRow, type LiveScoreCard, type LiveScoreData, type LiveStatRow, type LiveStatsCard, type LiveStatsData, type LiveTimelineCard, type LiveTimelineData, type MarketOddsBlock, type MarketOddsCard, type MarketOddsCardInsight, type MarketOddsEventData, type MarketOddsLiveBlock, type MarketOddsRow, type MatchState, type MomentumPoint, type MonitorPhase, type MonitorSport, type NbaCoHitEvidence, type NbaCoHitLeg, type NbaGameValue, type NbaInjuryEvent, type NbaInsight, type NbaInsightEventData, type NbaInsightSelection, type NbaJointGame, type NbaLadderEvidence, type NbaLadderRung, type NbaLadderStat, type NbaLineLane, type NbaLineMoveEvidence, type NbaLinePoint, type NbaListedTeammate, type NbaMatchupEvidence, type NbaMatchupPosition, type NbaMatchupTeam, type NbaPropReasonEvidence, type NbaQuarterLadderEvidence, type NbaQuarterRung, type NbaQuarterStat, type NbaSettleLine, type NbaSettlePlayer, type NbaSettleRecapEvidence, type NbaSettleSummary, type NbaSplitRow, type NbaTeammateOutEvidence, type NdjsonParser, NetworkError, type NflAtsGame, type NflAtsRecordEvidence, type NflInjuryPlayer, type NflInjuryReportEvidence, type NflInsight, type NflInsightEventData, type NflInsightKind, type NflInsightSelection, type NflLadderEvidence, type NflLadderRung, type NflLineMoveEvidence, type NflLineMoveLane, type NflMatchupEvidence, type NflPropReasonEvidence, type NflPropReasonGame, type NflSettleRecapEvidence, type NflSettleRecapLine, type NflSettleRecapPlayer, type NflSettleRecapSummary, type NonFootballSport, type OddsMovementCard, type OddsMovementEventData, type OddsMovementPoint, type PageContext, ParseError, type PinKind, type PinRef, type PlayerPropGame, type PlayerPropPrice, type PlayerPropStat, type PlayerPropsBundle, type PostMatchGoalLine, type PostMatchGoalsCard, type PostMatchGoalsData, type PostMatchNextCard, type PostMatchNextData, type PostMatchResultCard, type PostMatchResultData, type PostMatchStatRow, type PostMatchStatsCard, type PostMatchStatsData, type PostMatchTopPerformerCard, type PostMatchTopPerformerData, type PresetComboCell, type PresetGrid, type PresetGridOptions, type PresetMarketCell, type PresetPick, type PresetSinglesCell, type ProgressEventData, RateLimitError, type ReasonToBetCard, type ReasonToBetData, type RestingFormCard, type RestingFormData, type RestingNextCard, type RestingNextData, type RestingSeasonCard, type RestingSeasonData, type RestingStandingsCard, type RestingStandingsData, SIGNAL_TYPE_CODES, SPORTS, type ScheduleGroup, type ScheduleMatch, type SchedulePayload, type ScheduleSport, type SignalEntityType, type SignalInput, type SignalType, type SlipSelection, type SlipSport, type SportSpec, type StatesPayload, StatsWidgetClient, type StatsWidgetClientOptions, type StreamErrorEventData, type SubmitPlayBody, type SubmitPlayResult, type TransferRow, type TransfersCard, type TransfersData, type TurnCompleteEventData, UpstreamError, type UserContext, type WhereToWatchCard, type WhereToWatchData, type WidgetEntityEventName, type WidgetEntityType, type WidgetEventInput, type WidgetEventName, type WidgetLogInput, type WidgetOpenEventInput, type WidgetOpenEventName, type WidgetPopupAskEventInput, type WidgetPopupAskEventName, type WidgetPopupEventInput, type WidgetPopupEventName, WidgetSdkError, type WireEvent, createEventLogger, createNdjsonParser, isAddToSlipResult, isLimitCode, matchKey, mayPinOrSlip, slipSportOf, sportOf };
package/dist/index.d.ts CHANGED
@@ -100,6 +100,10 @@ interface GreetingDashboardTile {
100
100
  signal: GreetingDashboardSignalRef;
101
101
  /** "hero": the personalized lead tile (always full width). Older servers omit it. */
102
102
  emphasis?: GreetingDashboardTileEmphasis | null;
103
+ /** Hero top-row line ("Tip-off 02:30 · in 6 h"); shown only when the hero has no price. Older servers omit it. */
104
+ meta?: string | null;
105
+ /** Short text marks (team abbreviations) drawn as circles when imageUrls is empty. Older servers omit it. */
106
+ imageCodes?: string[] | null;
103
107
  }
104
108
  interface GreetingDashboard {
105
109
  layout: GreetingDashboardLayout;
@@ -697,6 +701,162 @@ interface NbaInsight {
697
701
  interface NbaInsightEventData {
698
702
  insight: NbaInsight;
699
703
  }
704
+ type NflInsightKind = 'settle_recap' | 'prop_reason' | 'ladder' | 'injury_report' | 'line_move' | 'ats_record' | 'matchup';
705
+ interface NflInsightSelection {
706
+ key: string;
707
+ marketDeveloperName: string;
708
+ selectionLabel: string;
709
+ side: string;
710
+ line?: string | null;
711
+ price: number;
712
+ quotedAtUtc: string;
713
+ }
714
+ interface NflPropReasonGame {
715
+ week: number;
716
+ opponent: string;
717
+ value?: number | null;
718
+ result?: string | null;
719
+ }
720
+ interface NflPropReasonEvidence {
721
+ playerId: number;
722
+ playerName: string;
723
+ propType: string;
724
+ line: string;
725
+ hits: number;
726
+ misses: number;
727
+ pushes: number;
728
+ n: number;
729
+ games: NflPropReasonGame[];
730
+ }
731
+ interface NflLadderRung {
732
+ at: string;
733
+ hits: number;
734
+ selectionKey: string;
735
+ }
736
+ interface NflLadderEvidence {
737
+ playerId: number;
738
+ playerName: string;
739
+ propType: string;
740
+ n: number;
741
+ rungs: NflLadderRung[];
742
+ }
743
+ interface NflInjuryPlayer {
744
+ name: string;
745
+ position?: string | null;
746
+ status: string;
747
+ }
748
+ interface NflInjuryReportEvidence {
749
+ teamId: number;
750
+ teamName: string;
751
+ teamAbbr: string;
752
+ opponentAbbr: string;
753
+ players: NflInjuryPlayer[];
754
+ morePlayers: number;
755
+ }
756
+ interface NflLineMoveLane {
757
+ market: string;
758
+ side: string;
759
+ openLine?: string | null;
760
+ openPrice: number;
761
+ openAt: string;
762
+ line?: string | null;
763
+ price: number;
764
+ quotedAtUtc: string;
765
+ }
766
+ interface NflLineMoveEvidence {
767
+ lanes: NflLineMoveLane[];
768
+ }
769
+ interface NflAtsGame {
770
+ week: number;
771
+ opponentAbbr: string;
772
+ spreadLine: string;
773
+ result: string;
774
+ }
775
+ interface NflAtsRecordEvidence {
776
+ teamId: number;
777
+ teamName: string;
778
+ teamAbbr: string;
779
+ finishedGames: number;
780
+ n: number;
781
+ w: number;
782
+ l: number;
783
+ p: number;
784
+ withoutOpening: number;
785
+ games: NflAtsGame[];
786
+ }
787
+ interface NflMatchupEvidence {
788
+ defenseTeamName: string;
789
+ defenseAbbr: string;
790
+ offenseTeamName: string;
791
+ offenseAbbr: string;
792
+ position: string;
793
+ basis: string;
794
+ yardsPerGame: number;
795
+ touchdownsPerGame: number;
796
+ rank: number;
797
+ rankedTeams: number;
798
+ n: number;
799
+ }
800
+ interface NflSettleRecapLine {
801
+ propType: string;
802
+ line?: string | null;
803
+ actual?: number | null;
804
+ result: string;
805
+ }
806
+ interface NflSettleRecapPlayer {
807
+ playerId: number;
808
+ name: string;
809
+ lines: NflSettleRecapLine[];
810
+ }
811
+ interface NflSettleRecapSummary {
812
+ over: number;
813
+ under: number;
814
+ pushes: number;
815
+ yes: number;
816
+ no: number;
817
+ voids: number;
818
+ n: number;
819
+ }
820
+ interface NflSettleRecapEvidence {
821
+ finalScore: string;
822
+ lineBasis: string;
823
+ players: NflSettleRecapPlayer[];
824
+ morePlayers: number;
825
+ summary: NflSettleRecapSummary;
826
+ }
827
+ interface NflInsight {
828
+ insightId: string;
829
+ matchId: number;
830
+ kind: string;
831
+ text: string;
832
+ title: string;
833
+ marketDeveloperName?: string | null;
834
+ marketLabel?: string | null;
835
+ selections: NflInsightSelection[];
836
+ disclaimer?: string | null;
837
+ homeTeamName: string;
838
+ awayTeamName: string;
839
+ homeTeamAbbr: string;
840
+ awayTeamAbbr: string;
841
+ competitionName: string;
842
+ addToSlipEnabled: boolean;
843
+ pinEnabled: boolean;
844
+ kickoffUtc?: string | null;
845
+ kickoffLabel?: string | null;
846
+ quotedAtUtc?: string | null;
847
+ sport: string;
848
+ propReason?: NflPropReasonEvidence | null;
849
+ ladder?: NflLadderEvidence | null;
850
+ injuryReport?: NflInjuryReportEvidence | null;
851
+ lineMove?: NflLineMoveEvidence | null;
852
+ atsRecord?: NflAtsRecordEvidence | null;
853
+ matchup?: NflMatchupEvidence | null;
854
+ settleRecap?: NflSettleRecapEvidence | null;
855
+ [key: string]: unknown;
856
+ }
857
+ interface NflInsightEventData {
858
+ insight: NflInsight;
859
+ }
700
860
  interface MarketOddsRow {
701
861
  selectionLabel: string;
702
862
  side?: string | null;
@@ -734,8 +894,11 @@ interface MarketOddsCard {
734
894
  competitionImagePath?: string | null;
735
895
  /** Server-rendered kickoff chip in the operator's zone + language. Prefer over local formatting of kickoffUtc. */
736
896
  kickoffLabel?: string | null;
737
- /** `basketball` on an NBA game card; absent or null reads as football. */
897
+ /** `basketball` on an NBA game card, `americanfootball` on an NFL one; absent or null reads as football. */
738
898
  sport?: string | null;
899
+ /** Short team names (NFL), drawn as the badge in place of a crest. */
900
+ homeTeamAbbr?: string | null;
901
+ awayTeamAbbr?: string | null;
739
902
  /** The strongest stat for this card's market and fixture, already in the turn's language. */
740
903
  insight?: MarketOddsCardInsight | null;
741
904
  /** Up to 2 stats for this card's exact market, strongest first; insights[0] is always the same
@@ -1158,7 +1321,7 @@ interface EventEnvelope<TType extends string, TData> {
1158
1321
  timestamp: string;
1159
1322
  data: TData;
1160
1323
  }
1161
- type ChatEvent = EventEnvelope<'progress', ProgressEventData> | EventEnvelope<'answer', AnswerEventData> | EventEnvelope<'entity_card', EntityCardEventData> | EventEnvelope<'action_button', ActionButtonEventData> | EventEnvelope<'intent_chip', IntentChipEventData> | EventEnvelope<'actions_loading', ActionsLoadingEventData> | EventEnvelope<'turn_complete', TurnCompleteEventData> | EventEnvelope<'betting_insight', BettingInsightEventData> | EventEnvelope<'nba_insight', NbaInsightEventData> | EventEnvelope<'market_odds', MarketOddsEventData> | EventEnvelope<'combo_card', ComboCardEventData> | EventEnvelope<'odds_movement', OddsMovementEventData> | EventEnvelope<'error', StreamErrorEventData>;
1324
+ type ChatEvent = EventEnvelope<'progress', ProgressEventData> | EventEnvelope<'answer', AnswerEventData> | EventEnvelope<'entity_card', EntityCardEventData> | EventEnvelope<'action_button', ActionButtonEventData> | EventEnvelope<'intent_chip', IntentChipEventData> | EventEnvelope<'actions_loading', ActionsLoadingEventData> | EventEnvelope<'turn_complete', TurnCompleteEventData> | EventEnvelope<'betting_insight', BettingInsightEventData> | EventEnvelope<'nba_insight', NbaInsightEventData> | EventEnvelope<'nfl_insight', NflInsightEventData> | EventEnvelope<'market_odds', MarketOddsEventData> | EventEnvelope<'combo_card', ComboCardEventData> | EventEnvelope<'odds_movement', OddsMovementEventData> | EventEnvelope<'error', StreamErrorEventData>;
1162
1325
  interface GameSummary {
1163
1326
  gameId: string;
1164
1327
  gameDay: string;
@@ -1380,6 +1543,38 @@ interface ClubRecordsPayload {
1380
1543
  sinceSeasonName: string | null;
1381
1544
  }
1382
1545
 
1546
+ interface SportSpec {
1547
+ readonly slipPrefix: string;
1548
+ readonly monitorPrefix: string;
1549
+ readonly label: string;
1550
+ readonly slippable: boolean;
1551
+ }
1552
+ declare const SPORTS: {
1553
+ readonly basketball: {
1554
+ readonly slipPrefix: "bb:";
1555
+ readonly monitorPrefix: "nba:";
1556
+ readonly label: "NBA";
1557
+ readonly slippable: true;
1558
+ };
1559
+ readonly americanfootball: {
1560
+ readonly slipPrefix: "af:";
1561
+ readonly monitorPrefix: "nfl:";
1562
+ readonly label: "NFL";
1563
+ readonly slippable: false;
1564
+ };
1565
+ };
1566
+ type NonFootballSport = keyof typeof SPORTS;
1567
+ /** The sports whose prices can reach an operator slip or a pin: those the map marks slippable. */
1568
+ type SlipSport = {
1569
+ [K in NonFootballSport]: (typeof SPORTS)[K]['slippable'] extends true ? K : never;
1570
+ }[NonFootballSport];
1571
+ /** undefined means football: every sport the map does not know is football. */
1572
+ declare function sportOf(v: unknown): NonFootballSport | undefined;
1573
+ /** True for football (no sport) and for a sport the map marks slippable: the only cases that may pin or slip. */
1574
+ declare function mayPinOrSlip(v: unknown): boolean;
1575
+ /** The sport when it may take a slip pick or a pin; undefined for football and for a sport that never does. */
1576
+ declare function slipSportOf(v: unknown): SlipSport | undefined;
1577
+
1383
1578
  type FetchLike = (input: string, init: RequestInit) => Promise<Response>;
1384
1579
  interface StatsWidgetClientOptions {
1385
1580
  operatorId: string;
@@ -1404,6 +1599,14 @@ interface ChatGrounding {
1404
1599
  season?: string;
1405
1600
  subject?: string;
1406
1601
  personaHint?: string;
1602
+ sport?: string;
1603
+ }
1604
+ /** The page the widget sits on. Sent on greeting requests only, so the greeting can lead with that page. */
1605
+ interface PageContext {
1606
+ sport: 'football' | 'nba';
1607
+ kind?: 'section' | 'competition' | 'match';
1608
+ matchId?: string | number;
1609
+ competitionId?: string | number;
1407
1610
  }
1408
1611
  /** Onboarding presets stage 2 (contract §3): what a tool's Send asked for. Sent only from a tool's
1409
1612
  * Send, beside the full sentence in `message`. The server ignores it unless every value is valid. */
@@ -1437,6 +1640,7 @@ interface ChatInput {
1437
1640
  clientCapabilities?: string[];
1438
1641
  /** Onboarding presets stage 2: set only by a preset tool's Send (contract §3). */
1439
1642
  preset?: ChatPreset;
1643
+ page?: PageContext;
1440
1644
  }
1441
1645
  type SignalType = 'MatchPageView' | 'PlayerPageView' | 'TeamPageView' | 'MarketView' | 'SearchQuery' | 'SessionDepth' | 'TimeOnPage' | 'InsightViewed' | 'InsightMarketClicked' | 'BetPlacedFromInsight' | 'InsightScrollDepth' | 'ToolCall' | 'EntityMention' | 'Handoff' | 'FollowUpQuery' | 'RecommendationDismissed';
1442
1646
  type SignalEntityType = 'Match' | 'Team' | 'Player' | 'Competition' | 'Market' | 'Article' | 'Session' | 'Query' | 'Conversation';
@@ -1454,7 +1658,7 @@ interface SignalInput {
1454
1658
  /** Zero-based tile position within the dashboard, when it is a dashboard tap. */
1455
1659
  tileIndex?: number;
1456
1660
  }
1457
- type SlipSport = 'basketball';
1661
+
1458
1662
  interface SlipSelection {
1459
1663
  matchOddsId: number;
1460
1664
  matchId: number;
@@ -1654,4 +1858,4 @@ interface NdjsonParser {
1654
1858
  }
1655
1859
  declare function createNdjsonParser(): NdjsonParser;
1656
1860
 
1657
- export { type ActionButtonEventData, type ActionsLoadingEventData, type AddToSlipHandler, type AddToSlipRejectReason, type AddToSlipResult, type AllTimeRow, type AnswerEventData, AuthError, type AvailableMarket, type BettingInsight, type BettingInsightEventData, type BettingInsightOdds, type ChatCallbacks, type ChatEvent, type ChatGrounding, type ChatHandle, type ChatInput, type ChatPreset, type ClubFanDashboardCard, type ClubFanDashboardHeadToHead, type ClubFanDashboardPayload, type ClubFixture, type ClubFixturesPayload, type ClubMatchLogRow, type ClubNextFixture, type ClubPerformanceMetric, type ClubPlayerAvailability, type ClubPlayerAvailabilityStatus, type ClubPlayerDetailPayload, type ClubPlayerPerformance, type ClubPlayerSeasonStats, type ClubRecordEntry, type ClubRecordsPayload, type ClubSquadPayload, type ClubSquadPlayer, type ClubSquadStatsPayload, type ClubStandingRow, type ClubStandingsPayload, type ComboCard, type ComboCardEventData, type ComboLeg, type ComboReplacedLeg, type CongestedWeekCard, type CongestedWeekData, type CongestedWeekEntry, Conversation, type CountdownCard, type CountdownData, ENTITY_TYPE_CODES, type EntityCard, type EntityCardEventData, type EntityCardScope, type EntityCardStat, type EventBatch, type EventLogger, type EventLoggerOptions, type FetchLike, type FixtureCard, type FixtureCardData, ForbiddenError, type FormAndH2H, type FormMatch, type GameListPayload, type GameResultPayload, type GameStatePayload, type GameSummary, type GreetingDashboard, type GreetingDashboardLayout, type GreetingDashboardSignalRef, type GreetingDashboardSpan, type GreetingDashboardTile, type GreetingDashboardTileEmphasis, type HeadToHead, type InjuriesCard, type InjuriesCardData, type InjuryRow, type IntentChipEventData, LIMIT_CODES, type LeaderboardChampion, type LeaderboardPayload, type LeaderboardRow, type LeagueStarResult, type LimitCode, type LimitDetails, LimitError, type LinkRow, type LinksCard, type LinksData, type LiveEventLine, type LiveMonitorBasketball, type LiveMonitorEvent, type LiveMonitorFact, type LiveMonitorMarket, type LiveMonitorMatch, type LiveMonitorSnapshot, type LiveMonitorStatPrice, type LiveMonitorStatRow, type LiveScoreCard, type LiveScoreData, type LiveStatRow, type LiveStatsCard, type LiveStatsData, type LiveTimelineCard, type LiveTimelineData, type MarketOddsBlock, type MarketOddsCard, type MarketOddsCardInsight, type MarketOddsEventData, type MarketOddsLiveBlock, type MarketOddsRow, type MatchState, type MomentumPoint, type MonitorPhase, type MonitorSport, type NbaCoHitEvidence, type NbaCoHitLeg, type NbaGameValue, type NbaInjuryEvent, type NbaInsight, type NbaInsightEventData, type NbaInsightSelection, type NbaJointGame, type NbaLadderEvidence, type NbaLadderRung, type NbaLadderStat, type NbaLineLane, type NbaLineMoveEvidence, type NbaLinePoint, type NbaListedTeammate, type NbaMatchupEvidence, type NbaMatchupPosition, type NbaMatchupTeam, type NbaPropReasonEvidence, type NbaQuarterLadderEvidence, type NbaQuarterRung, type NbaQuarterStat, type NbaSettleLine, type NbaSettlePlayer, type NbaSettleRecapEvidence, type NbaSettleSummary, type NbaSplitRow, type NbaTeammateOutEvidence, type NdjsonParser, NetworkError, type OddsMovementCard, type OddsMovementEventData, type OddsMovementPoint, ParseError, type PinKind, type PinRef, type PlayerPropGame, type PlayerPropPrice, type PlayerPropStat, type PlayerPropsBundle, type PostMatchGoalLine, type PostMatchGoalsCard, type PostMatchGoalsData, type PostMatchNextCard, type PostMatchNextData, type PostMatchResultCard, type PostMatchResultData, type PostMatchStatRow, type PostMatchStatsCard, type PostMatchStatsData, type PostMatchTopPerformerCard, type PostMatchTopPerformerData, type PresetComboCell, type PresetGrid, type PresetGridOptions, type PresetMarketCell, type PresetPick, type PresetSinglesCell, type ProgressEventData, RateLimitError, type ReasonToBetCard, type ReasonToBetData, type RestingFormCard, type RestingFormData, type RestingNextCard, type RestingNextData, type RestingSeasonCard, type RestingSeasonData, type RestingStandingsCard, type RestingStandingsData, SIGNAL_TYPE_CODES, type ScheduleGroup, type ScheduleMatch, type SchedulePayload, type ScheduleSport, type SignalEntityType, type SignalInput, type SignalType, type SlipSelection, type SlipSport, type StatesPayload, StatsWidgetClient, type StatsWidgetClientOptions, type StreamErrorEventData, type SubmitPlayBody, type SubmitPlayResult, type TransferRow, type TransfersCard, type TransfersData, type TurnCompleteEventData, UpstreamError, type UserContext, type WhereToWatchCard, type WhereToWatchData, type WidgetEntityEventName, type WidgetEntityType, type WidgetEventInput, type WidgetEventName, type WidgetLogInput, type WidgetOpenEventInput, type WidgetOpenEventName, type WidgetPopupAskEventInput, type WidgetPopupAskEventName, type WidgetPopupEventInput, type WidgetPopupEventName, WidgetSdkError, type WireEvent, createEventLogger, createNdjsonParser, isAddToSlipResult, isLimitCode, matchKey };
1861
+ export { type ActionButtonEventData, type ActionsLoadingEventData, type AddToSlipHandler, type AddToSlipRejectReason, type AddToSlipResult, type AllTimeRow, type AnswerEventData, AuthError, type AvailableMarket, type BettingInsight, type BettingInsightEventData, type BettingInsightOdds, type ChatCallbacks, type ChatEvent, type ChatGrounding, type ChatHandle, type ChatInput, type ChatPreset, type ClubFanDashboardCard, type ClubFanDashboardHeadToHead, type ClubFanDashboardPayload, type ClubFixture, type ClubFixturesPayload, type ClubMatchLogRow, type ClubNextFixture, type ClubPerformanceMetric, type ClubPlayerAvailability, type ClubPlayerAvailabilityStatus, type ClubPlayerDetailPayload, type ClubPlayerPerformance, type ClubPlayerSeasonStats, type ClubRecordEntry, type ClubRecordsPayload, type ClubSquadPayload, type ClubSquadPlayer, type ClubSquadStatsPayload, type ClubStandingRow, type ClubStandingsPayload, type ComboCard, type ComboCardEventData, type ComboLeg, type ComboReplacedLeg, type CongestedWeekCard, type CongestedWeekData, type CongestedWeekEntry, Conversation, type CountdownCard, type CountdownData, ENTITY_TYPE_CODES, type EntityCard, type EntityCardEventData, type EntityCardScope, type EntityCardStat, type EventBatch, type EventLogger, type EventLoggerOptions, type FetchLike, type FixtureCard, type FixtureCardData, ForbiddenError, type FormAndH2H, type FormMatch, type GameListPayload, type GameResultPayload, type GameStatePayload, type GameSummary, type GreetingDashboard, type GreetingDashboardLayout, type GreetingDashboardSignalRef, type GreetingDashboardSpan, type GreetingDashboardTile, type GreetingDashboardTileEmphasis, type HeadToHead, type InjuriesCard, type InjuriesCardData, type InjuryRow, type IntentChipEventData, LIMIT_CODES, type LeaderboardChampion, type LeaderboardPayload, type LeaderboardRow, type LeagueStarResult, type LimitCode, type LimitDetails, LimitError, type LinkRow, type LinksCard, type LinksData, type LiveEventLine, type LiveMonitorBasketball, type LiveMonitorEvent, type LiveMonitorFact, type LiveMonitorMarket, type LiveMonitorMatch, type LiveMonitorSnapshot, type LiveMonitorStatPrice, type LiveMonitorStatRow, type LiveScoreCard, type LiveScoreData, type LiveStatRow, type LiveStatsCard, type LiveStatsData, type LiveTimelineCard, type LiveTimelineData, type MarketOddsBlock, type MarketOddsCard, type MarketOddsCardInsight, type MarketOddsEventData, type MarketOddsLiveBlock, type MarketOddsRow, type MatchState, type MomentumPoint, type MonitorPhase, type MonitorSport, type NbaCoHitEvidence, type NbaCoHitLeg, type NbaGameValue, type NbaInjuryEvent, type NbaInsight, type NbaInsightEventData, type NbaInsightSelection, type NbaJointGame, type NbaLadderEvidence, type NbaLadderRung, type NbaLadderStat, type NbaLineLane, type NbaLineMoveEvidence, type NbaLinePoint, type NbaListedTeammate, type NbaMatchupEvidence, type NbaMatchupPosition, type NbaMatchupTeam, type NbaPropReasonEvidence, type NbaQuarterLadderEvidence, type NbaQuarterRung, type NbaQuarterStat, type NbaSettleLine, type NbaSettlePlayer, type NbaSettleRecapEvidence, type NbaSettleSummary, type NbaSplitRow, type NbaTeammateOutEvidence, type NdjsonParser, NetworkError, type NflAtsGame, type NflAtsRecordEvidence, type NflInjuryPlayer, type NflInjuryReportEvidence, type NflInsight, type NflInsightEventData, type NflInsightKind, type NflInsightSelection, type NflLadderEvidence, type NflLadderRung, type NflLineMoveEvidence, type NflLineMoveLane, type NflMatchupEvidence, type NflPropReasonEvidence, type NflPropReasonGame, type NflSettleRecapEvidence, type NflSettleRecapLine, type NflSettleRecapPlayer, type NflSettleRecapSummary, type NonFootballSport, type OddsMovementCard, type OddsMovementEventData, type OddsMovementPoint, type PageContext, ParseError, type PinKind, type PinRef, type PlayerPropGame, type PlayerPropPrice, type PlayerPropStat, type PlayerPropsBundle, type PostMatchGoalLine, type PostMatchGoalsCard, type PostMatchGoalsData, type PostMatchNextCard, type PostMatchNextData, type PostMatchResultCard, type PostMatchResultData, type PostMatchStatRow, type PostMatchStatsCard, type PostMatchStatsData, type PostMatchTopPerformerCard, type PostMatchTopPerformerData, type PresetComboCell, type PresetGrid, type PresetGridOptions, type PresetMarketCell, type PresetPick, type PresetSinglesCell, type ProgressEventData, RateLimitError, type ReasonToBetCard, type ReasonToBetData, type RestingFormCard, type RestingFormData, type RestingNextCard, type RestingNextData, type RestingSeasonCard, type RestingSeasonData, type RestingStandingsCard, type RestingStandingsData, SIGNAL_TYPE_CODES, SPORTS, type ScheduleGroup, type ScheduleMatch, type SchedulePayload, type ScheduleSport, type SignalEntityType, type SignalInput, type SignalType, type SlipSelection, type SlipSport, type SportSpec, type StatesPayload, StatsWidgetClient, type StatsWidgetClientOptions, type StreamErrorEventData, type SubmitPlayBody, type SubmitPlayResult, type TransferRow, type TransfersCard, type TransfersData, type TurnCompleteEventData, UpstreamError, type UserContext, type WhereToWatchCard, type WhereToWatchData, type WidgetEntityEventName, type WidgetEntityType, type WidgetEventInput, type WidgetEventName, type WidgetLogInput, type WidgetOpenEventInput, type WidgetOpenEventName, type WidgetPopupAskEventInput, type WidgetPopupAskEventName, type WidgetPopupEventInput, type WidgetPopupEventName, WidgetSdkError, type WireEvent, createEventLogger, createNdjsonParser, isAddToSlipResult, isLimitCode, matchKey, mayPinOrSlip, slipSportOf, sportOf };
package/dist/index.js CHANGED
@@ -742,6 +742,23 @@ function isAddToSlipResult(v) {
742
742
  return false;
743
743
  }
744
744
  }
745
+
746
+ // src/sports.ts
747
+ var SPORTS = {
748
+ basketball: { slipPrefix: "bb:", monitorPrefix: "nba:", label: "NBA", slippable: true },
749
+ americanfootball: { slipPrefix: "af:", monitorPrefix: "nfl:", label: "NFL", slippable: false }
750
+ };
751
+ function sportOf(v) {
752
+ return typeof v === "string" && Object.prototype.hasOwnProperty.call(SPORTS, v) ? v : void 0;
753
+ }
754
+ function mayPinOrSlip(v) {
755
+ const sport = sportOf(v);
756
+ return sport === void 0 || SPORTS[sport].slippable;
757
+ }
758
+ function slipSportOf(v) {
759
+ const sport = sportOf(v);
760
+ return sport !== void 0 && SPORTS[sport].slippable ? sport : void 0;
761
+ }
745
762
  export {
746
763
  AuthError,
747
764
  Conversation,
@@ -753,6 +770,7 @@ export {
753
770
  ParseError,
754
771
  RateLimitError,
755
772
  SIGNAL_TYPE_CODES,
773
+ SPORTS,
756
774
  StatsWidgetClient,
757
775
  UpstreamError,
758
776
  WidgetSdkError,
@@ -760,6 +778,9 @@ export {
760
778
  createNdjsonParser,
761
779
  isAddToSlipResult,
762
780
  isLimitCode,
763
- matchKey
781
+ matchKey,
782
+ mayPinOrSlip,
783
+ slipSportOf,
784
+ sportOf
764
785
  };
765
786
  //# sourceMappingURL=index.js.map