import type { SmartRouteResponse, WsOrderSubmitted } from "@agg-build/sdk";
import { type PlaceOrderOutcome, type PlaceOrderRoutingRow, type PlaceOrderTab, type TradingVenue } from "../types";
import type { BuildLiveRouteCardsParams, PlaceOrderOutcomeClassNameParams, PlaceOrderExecutionStepGroup, PlaceOrderFailureStep, PlaceOrderFailureSummary, PlaceOrderOutcomeLabelValue, PlaceOrderQuoteResult, PlaceOrderQuoteStatus, PlaceOrderResultTone, PlaceOrderRouteCard, PlaceOrderTerminalOrderEvent, PlaceOrderTradingLabels, PlaceOrderVenueOutcome, ResolvePlaceOrderQuoteResultParams, ResolvePlaceOrderQuoteStatusParams, ResolvePlaceOrderTabKeyParams } from "./index.place-order.types";
export declare const extractGeoBlockedVenues: (warnings: SmartRouteResponse["warnings"]) => Set<string>;
/** Pure helpers for PlaceOrder view-model shaping, formatting, and keyboard logic. */
export declare const getPlaceOrderContainerClassName: () => string;
export declare const getResultValueClassName: (tone: PlaceOrderResultTone) => string;
/**
 * Determines if an outcome is "positive" (typically Yes/first outcome).
 *
 * Uses index as the primary signal: index 0 is positive, index 1+ is negative.
 * This aligns with the standard binary prediction market convention where
 * the first outcome is "Yes" and the second is "No".
 */
export declare const resolveIsPositiveOutcome: (_outcome: PlaceOrderOutcomeLabelValue, index: number) => boolean;
export declare const getOutcomeButtonClassName: ({ enableAnimations, isActive, isPositive, }: PlaceOrderOutcomeClassNameParams) => string;
export declare const mapVenueMarketOutcomesToPlaceOrderOutcomes: (venueMarketOutcomes: PlaceOrderVenueOutcome[] | null | undefined) => PlaceOrderOutcome[];
export declare const mapQuoteDataToRoutingRows: (quoteData: ResolvePlaceOrderQuoteResultParams["quoteData"]) => PlaceOrderRoutingRow[];
/**
 * Aggregate execution outcome for a (possibly split) order.
 * - `pending`          – not all order legs have reached a terminal state yet
 * - `full_success`     – every leg filled completely
 * - `partial_failure`  – at least one leg partially filled or failed while another filled/partially filled
 * - `full_failure`     – every leg failed with no fills
 */
export type PlaceOrderAggregateOrderStatus = "pending" | "full_success" | "partial_failure" | "full_failure";
/**
 * Derives the aggregate outcome once all order legs of a split (or single) trade
 * have terminal WebSocket events. Returns `"pending"` until every orderId has a
 * corresponding terminal event so the UI never transitions prematurely.
 */
export declare const deriveAggregateOrderStatus: (orderIds: string[], terminalEvents: PlaceOrderTerminalOrderEvent[]) => PlaceOrderAggregateOrderStatus;
export declare const resolvePlaceOrderQuoteResult: ({ labels, quoteData, tradeSide, }: ResolvePlaceOrderQuoteResultParams) => PlaceOrderQuoteResult | null;
export declare const sanitizePlaceOrderAmount: (value: number) => number;
export declare const getTradingRoutePriceLabel: (value: number) => string;
export declare const resolvePlaceOrderQuoteStatus: ({ amount, labels, quoteData, selectedMarket, }: ResolvePlaceOrderQuoteStatusParams) => PlaceOrderQuoteStatus;
export declare const buildLiveRouteCards: ({ labels, quoteData, tradeSide, eventVenues, }: BuildLiveRouteCardsParams) => PlaceOrderRouteCard[];
export declare const resolveExecutionVenueFromQuote: (quoteData: SmartRouteResponse | null) => TradingVenue | undefined;
export declare const getPlaceOrderPotentialReturn: (quoteData: SmartRouteResponse | null | undefined) => number;
export declare const buildPlaceOrderExecutionStepGroups: ({ labels, orderId, quoteData, submittedOrders, }: {
    labels: PlaceOrderTradingLabels;
    orderId?: string;
    quoteData: SmartRouteResponse | null | undefined;
    submittedOrders?: WsOrderSubmitted[];
}) => PlaceOrderExecutionStepGroup[];
export declare const groupPlaceOrderFailureSteps: (steps: PlaceOrderFailureStep[]) => PlaceOrderFailureStep[][];
export declare const buildPlaceOrderExecutionStepGroupsFromFailureSummary: ({ labels, summary, treatPartialAsComplete, }: {
    labels: PlaceOrderTradingLabels;
    summary: PlaceOrderFailureSummary;
    treatPartialAsComplete?: boolean;
}) => PlaceOrderExecutionStepGroup[];
export declare const normalizePlaceOrderErrorMessage: ({ errorMessage, fallbackMessage, }: {
    errorMessage?: string | null;
    fallbackMessage: string;
}) => string;
/**
 * Sum filled + partially-filled amounts (1e6-atomic) across terminal events
 * and subtract from the originally-requested amount. Works for both buy
 * (USD remainder) and sell (share remainder) — the executor uses the same
 * 1e6 atomic convention for `filledAmountRaw` in both directions.
 */
export declare const getPlaceOrderUnfilledRemaining: ({ originalAmount, terminalOrderEvents, }: {
    originalAmount: number;
    terminalOrderEvents?: PlaceOrderTerminalOrderEvent[];
}) => number;
export declare const buildPlaceOrderFailureSummary: ({ actionLabel, canRetryRemaining, errorMessage, eventImage, eventSubtitle, eventTitle, labels, orderId, quoteData, submittedOrders, terminalOrderEvents, }: {
    actionLabel: string;
    canRetryRemaining?: boolean;
    errorMessage?: string;
    eventImage?: string | null;
    eventSubtitle?: string;
    eventTitle: string;
    labels: PlaceOrderTradingLabels;
    orderId?: string;
    quoteData: SmartRouteResponse | null | undefined;
    submittedOrders?: WsOrderSubmitted[];
    terminalOrderEvents?: PlaceOrderTerminalOrderEvent[];
}) => PlaceOrderFailureSummary;
export declare const buildPlaceOrderShareText: ({ actionLabel, amountLabel, eventTitle, potentialReturnLabel, tab, toWinLabel, tradingLabels, }: {
    actionLabel: string;
    amountLabel: string;
    eventTitle: string;
    potentialReturnLabel?: string;
    tab: "buy" | "sell";
    toWinLabel: string;
    tradingLabels: Pick<PlaceOrderTradingLabels, "amount" | "potentialReturnBonus" | "toWin" | "withSmartRouting">;
}) => string;
export declare const resolveNextTabFromKey: ({ currentTab, key, }: ResolvePlaceOrderTabKeyParams) => PlaceOrderTab | null;
export declare const sanitizePercentageInput: (value: string) => string;
export declare const finalizePercentageValue: (value: string | undefined) => string;
export declare const parsePercentageValue: (value: string | undefined) => number | null;
export declare const formatPercentageValue: (value: string | undefined) => string;
export declare const isPercentageBelowMinimum: (value: string | undefined, minimumValue: number | null) => boolean;
