import type { FC, MutableRefObject, ReactNode } from "react"; export type ChartExecutionMode = | "market" | "buy_limit" | "sell_limit" | "buy_stop" | "sell_stop" | "buy_stop_limit" | "sell_stop_limit"; export type DealerOrderSide = "buy" | "sell"; /** MT5 ORDER_TIME_* values: 0 = GTC, 1 = Today, 2 = Specified, 3 = Specified day */ export type DealerTypeTime = 0 | 1 | 2 | 3; export type ChartWidgetSymbol = { readonly ticker: string; readonly display_name: string; readonly logo_urls: readonly string[]; readonly description: string; readonly type: string; readonly session: string; readonly pricescale: number; readonly resolve_symbol: string; }; export type ChartWidgetAccountTradeStat = { readonly balance: number; readonly equity: number; readonly margin: number; readonly marginFree: number; readonly marginLevel?: number; }; export type ChartWidgetAccount = { readonly id: string; readonly login: string; readonly label: string; readonly currency: string; readonly tradeStat: ChartWidgetAccountTradeStat; }; export type WidgetTradingAccount = { readonly login: number; readonly display_title: string; readonly balance: number; readonly currency: string; }; export type ChartOpenPosition = { readonly ticket: string; readonly login: string; readonly symbol: string; readonly displaySymbol: string; readonly openTimeMs: number; readonly time: string; readonly type: "buy" | "sell"; readonly volumeLots: number; readonly openPrice: number; readonly stopLoss?: number; readonly takeProfit?: number; readonly currentPrice: number; readonly marketBid?: number; readonly marketAsk?: number; readonly swap: number; readonly profit: number; readonly comment: string; readonly digits: number; }; export type ChartPendingOrder = { readonly ticket: string; readonly login: string; readonly symbol: string; readonly displaySymbol: string; readonly openTimeMs: number; readonly time: string; readonly typeLabel: string; readonly orderType: number; readonly typeTime: number; readonly side: "buy" | "sell"; readonly volumeLots: number; readonly volumeFilledLots: number; readonly orderPrice: number; readonly priceTrigger?: number; readonly stopLoss?: number; readonly takeProfit?: number; readonly currentPrice: number; readonly comment: string; readonly digits: number; }; export type ChartSubmitOrderRequest = { readonly login: string; readonly symbolTicker: string; readonly executionMode: ChartExecutionMode; readonly side: DealerOrderSide; readonly orderType: number; readonly volumeLots: number; readonly stopLoss?: number; readonly takeProfit?: number; readonly priceOrder?: number; readonly priceTrigger?: number; readonly comment: string; readonly typeTime: DealerTypeTime; readonly expirationDateTime?: string; readonly expirationDay?: string; readonly bid: number; readonly ask: number; }; export type ChartSubmitOrderResult = { readonly success: boolean; readonly ticket?: string; readonly message?: string; readonly side?: DealerOrderSide; readonly volumeLots?: number; readonly displaySymbol?: string; readonly price?: number; }; export type ChartActionResult = { readonly success: boolean; readonly message?: string; }; export type ChartModifyOrderRequest = { readonly volumeLots: number; readonly priceOrder: number; readonly priceTrigger?: number; readonly stopLoss?: number; readonly takeProfit?: number; readonly comment: string; }; export type ChartNewOrderControls = { readonly open: () => void; readonly setSelectedLogin: (login: string) => void; }; export type ChartNewOrderControlsRef = MutableRefObject; /** TradingView Charting Library widget instance from your host app. */ export type ChartingLibraryWidget = object; export type WebTradingWidgetVariant = "chart" | "news" | "chart-v2"; export type WebTradingWidgetHostChartProps = { /** Host-owned TradingView widget (dashboard embed mode). */ readonly chartWidget?: ChartingLibraryWidget | null; }; export type WidgetLanguage = | "en" | "zh" | "vi" | "th" | "ko" | "ja" | "mn" | "ru"; /** Maps host locale strings (e.g. `en-US`) to a supported widget language. */ export declare function normalizeWidgetLanguage( language?: string | null, ): WidgetLanguage; export declare function toTradingViewLocale( language: WidgetLanguage, ): string; export type WebTradingWidgetProps = WebTradingWidgetHostChartProps & { readonly baseUrl: string; /** Tick WebSocket URL. When omitted, derived from `baseUrl`. */ readonly tickWebSocketUrl: string; /** Host-provided trading accounts (`login`, `display_title`, `balance`). */ readonly accounts: readonly WidgetTradingAccount[]; /** When true, account selection UI shows a loading state while host accounts load. */ readonly isAccountsLoading?: boolean; /** Auth token stored in localStorage under `web-trading-token` for API requests. */ readonly token?: string | null; readonly language?: WidgetLanguage; readonly variant?: WebTradingWidgetVariant; /** Default order volume in lots. Falls back to 0.01 when omitted. */ readonly defaultVolumeLots?: number; /** When set, opens the side panel Scan Result tab with this URL in an iframe. */ readonly scanResultUrl?: string | null; readonly onScanResultUrlChange?: (url: string | null) => void; /** Called when the scan result iframe finishes loading. */ readonly onScanResultLoad?: () => void; /** When `true`, opens the scan tab. Pair with `onScanClick` to sync IC Candle scan button state. */ readonly scanOpen?: boolean; /** Called when the scan tab is opened (`true`) or closed (`false`). */ readonly onScanClick?: (open: boolean) => void; readonly children?: ReactNode; /** Navigates to this URL when "Just back" is clicked on the no-accounts modal. */ readonly backUrl?: string; /** Navigates to this URL when "Create account" is clicked on the no-accounts modal. */ readonly createAccountUrl?: string; readonly theme?: 'light' | 'dark'; /** When provided, shows a "More detail" link at the bottom of the History tab. */ readonly dealDetailUrl?: string; }; export declare const WebTradingWidget: FC; // export declare function registerNewOrderToolbarButton( // chartWidget: object, // onClick: () => void, // ): Promise; export type ChartNewsOrdersOverlayProps = { readonly baseUrl: string; /** Tick WebSocket URL. When omitted, derived from `baseUrl`. */ readonly tickWebSocketUrl: string; readonly accounts: readonly WidgetTradingAccount[]; readonly isAccountsLoading?: boolean; readonly language?: WidgetLanguage; readonly containerRef?: import("react").RefObject; readonly onCreateNewOrder?: () => void; }; export declare function ChartNewsOrdersOverlay( props: ChartNewsOrdersOverlayProps, ): import("react").JSX.Element;