import type { ChartTimeRange, EventTradingState, UseMidpointsResult } from "@agg-build/hooks";
import type { LineChartPoint, LineChartType } from "../../primitives/chart";
import type { EventListItemVenueInfoMap, VenueEventWithMarkets } from "../item/event-list-item.types";
import type { OutcomeByVenue } from "./event-list-item-details.utils";
export type EventListItemDetailsEvent = VenueEventWithMarkets;
/** @deprecated Use `ChartTimeRange` from `@agg-build/hooks` instead. */
export type EventListItemDetailsTimeRange = ChartTimeRange;
export type EventListItemDetailsStat = {
    label: string;
    value: string;
    delta?: string;
    deltaTone?: "positive" | "negative" | "neutral";
};
export type EventListItemDetailsClassNames = Partial<{
    root: string;
    header: string;
    title: string;
    headerPills: string;
    headerStats: string;
    summary: string;
    outcomeBadges: string;
    segmentedControl: string;
    chart: string;
    footer: string;
    timeRange: string;
}>;
export type EventListItemDetailsBaseProps = {
    /** Class name overrides for the details card slots. */
    classNames?: EventListItemDetailsClassNames;
    /** Market ID to preselect after event sync is initialized. */
    defaultMarketId?: string;
    /** Outcome ID to preselect alongside defaultMarketId. */
    defaultOutcomeId?: string;
    /** Venue metadata used to enrich venue labels in the details card. */
    venueInfo?: EventListItemVenueInfoMap;
    /** Optional stat pills shown in the details summary area. */
    detailsStats?: EventListItemDetailsStat[];
    /** Trading state data used to drive prices and market status. */
    eventTradingState?: EventTradingState;
    /** Whether the details card should render its loading state. */
    isLoading?: boolean;
    /** Accessible label applied to the interactive details card. */
    ariaLabel?: string;
    /** Initially selected chart time range. */
    defaultTimeRange?: EventListItemDetailsTimeRange;
    /** Called when the details card is clicked. */
    onClick?: (event?: EventListItemDetailsEvent) => void;
    /** Pre-fetched midpoint data (best price included) passed from parent. Optional for backward compatibility. */
    midpointsResult?: UseMidpointsResult;
};
export type EventListItemDetailsLoadingProps = EventListItemDetailsBaseProps & {
    /** Forces the details component into its loading state. */
    isLoading: true;
    /** Prevents passing a resolved event while loading. */
    event?: never;
    /** Optional event ID used to derive loading-state cache context. */
    eventId?: string;
};
export type EventListItemDetailsWithEventProps = EventListItemDetailsBaseProps & {
    /** Fully resolved event rendered inside the details card. */
    event: EventListItemDetailsEvent;
    /** Optional explicit event ID override. */
    eventId?: string;
    /** Marks the details card as loaded when event data is present. */
    isLoading?: false;
};
export type EventListItemDetailsWithEventIdProps = EventListItemDetailsBaseProps & {
    /** Prevents passing a full event object in ID-driven mode. */
    event?: never;
    /** Event ID used to fetch or resolve the details data. */
    eventId: string;
    /** Marks the details card as loaded when ID-driven fetching is used. */
    isLoading?: false;
};
export type EventListItemDetailsProps = EventListItemDetailsLoadingProps | EventListItemDetailsWithEventProps | EventListItemDetailsWithEventIdProps;
export type EventListItemDetailsContentProps = EventListItemDetailsBaseProps & {
    /** Resolved event content rendered by the details layout. */
    event: EventListItemDetailsEvent;
};
export type ProbabilityMode = "yes" | "no";
export type ProbabilityModeConfig = {
    switchLabel: string;
    sourceOutcomeLabel: string;
    transformProbability: (value: number) => number;
};
export type GraphSectionOutcomeByVenue = OutcomeByVenue;
export type GraphSectionVenue = GraphSectionOutcomeByVenue["venue"];
export type NormalizedVenueProbability = {
    venue: GraphSectionVenue;
    venueLabel: string;
    market: GraphSectionOutcomeByVenue["market"];
    outcome: GraphSectionOutcomeByVenue["outcome"];
    probability: number | undefined;
    color: string;
};
export type VenueChartSeries = {
    id: string;
    venue: GraphSectionVenue;
    color: string;
    points: LineChartPoint[];
    lineWidth?: number;
    lineStyle?: "solid" | "dotted" | "dashed";
};
export type EventListItemDetailsGraphSectionProps = {
    /** Class name overrides shared with the parent details component. */
    classNames?: EventListItemDetailsClassNames;
    /** Chart type currently selected for the graph section. */
    selectedChartType: LineChartType;
    /** Venue metadata used to enrich series labels and pills. */
    venueInfo?: EventListItemVenueInfoMap;
    /** Venue markets used to build the chart series. */
    venueMarkets: EventListItemDetailsContentProps["event"]["venueMarkets"];
    /** Market id used to scope the chart to the active market cluster. */
    selectedMarketId?: string | null;
    /**
     * WS+REST merged prices (WS wins) keyed by outcome ID. General-purpose live
     * prices for contexts where per-venue accuracy or availability doesn't matter.
     */
    livePrices: Map<string, number>;
    /**
     * WS-only prices keyed by outcome ID. Used for chart venue badges so each
     * badge shows its own venue's price rather than the cross-venue best.
     * Falls back to `outcome.price` when a venue has no WS data yet.
     */
    wsLivePrices: Map<string, number>;
    /**
     * REST cross-venue best prices keyed by outcome ID. Used for the outcome
     * selector switch so it shows the lowest available price across venues rather
     * than the WS price of a single venue.
     */
    restMidpoints: Map<string, number>;
    /** Canonical yes-side midpoint/reference price for the active cluster. */
    bestMidpoint?: number;
    /**
     * Trusted top-of-book per-outcome prices keyed by outcome ID. Drives the
     * outcome selector switch when present so the displayed price is the live
     * bestAsk rather than a stale midpoint.
     */
    bestPrices?: ReadonlyMap<string, {
        bestBid?: number;
        bestAsk?: number;
    }>;
    /** Override live WS subscriptions for the chart hook.
     *  Set to `false` when a parent manages subscriptions centrally. */
    live?: boolean;
    /**
     * Per-chart range override that takes precedence over the user's global
     * `selectedChartTimeRange`. The auto-fallback effect sets this to `"ALL"`
     * when the user-selected range is empty for the current subject, so the
     * chart displays usable data without mutating the user's preference.
     * `null` means "use the user's selection".
     */
    rangeOverride: import("@agg-build/hooks").ChartTimeRange | null;
    /**
     * Called by the graph section's auto-fallback effect to set a local
     * override. Passing `null` clears the override (used by the parent on
     * subject change / explicit user range pick).
     */
    onRangeOverrideChange: (range: import("@agg-build/hooks").ChartTimeRange | null) => void;
};
