import { CSSProperties, ReactElement } from 'react'; import { ChartAxis, ChartBackground, ChartHoverStyle, ChartLoadingStyle, ChartEmptyState, ChartMotion, ChartStyle, ChartSurface } from '../../types'; import { AnimatedNumberVariant } from '../../motion/animated-number'; /** One position in a strategy. */ export interface PayoffLeg { /** `call` or `put` options, or `stock` held from `strike`. */ type: 'call' | 'put' | 'stock'; /** `long` buys (default); `short` sells. */ side?: 'long' | 'short'; /** Strike price; for stock, the price paid or sold at. */ strike: number; /** Premium per share paid (long) or received (short). Defaults to 0. */ premium?: number; /** Contracts, or shares for stock. Defaults to 1. */ quantity?: number; } export interface PayoffChartCardProps { /** Optional visible title. Use aria-label to name an embedded chart. */ title?: string; /** Show the header and its stats. Defaults to true. */ header?: boolean; /** Accessible name, independent of the visible title. */ 'aria-label'?: string; /** The strategy's positions, all expiring together. */ legs: readonly PayoffLeg[]; /** Today's price of the underlying: marked on the plot and read in the headline at rest. */ spot?: number; /** Underlying prices to draw. Defaults to 30% either side of the strikes and spot. */ priceRange?: readonly [number, number]; /** Shares per option contract. Defaults to 100. */ multiplier?: number; /** Money format for profit and loss, e.g. `{ style: 'currency', currency: 'EUR' }`. */ valueFormat?: Intl.NumberFormatOptions; /** Price format for the underlying. Defaults to valueFormat. */ priceFormat?: Intl.NumberFormatOptions; locale?: string; /** Plot height in pixels. Defaults to 220. */ height?: number; /** Draws the payoff line as a lit tube with a soft shadow. */ depth?: boolean; axis?: ChartAxis; background?: ChartBackground; hoverStyle?: ChartHoverStyle; surface?: ChartSurface; numberStyle?: AnimatedNumberVariant; loading?: boolean; loadingStyle?: ChartLoadingStyle; /** * What the card shows with no legs: `dots` (default), the chart's own `shape`, your own element * such as `No positions`, or `null` for nothing. */ empty?: ChartEmptyState; motion?: ChartMotion; className?: string; style?: CSSProperties | ChartStyle; } export interface PayoffPoint { price: number; pnl: number; } /** Profit or loss of every leg together, at expiry, if the underlying ends at `price`. */ export declare function payoffAt(legs: readonly PayoffLeg[], multiplier: number, price: number): number; export interface PayoffSummary { points: PayoffPoint[]; breakevens: number[]; /** Null when profit keeps growing as the price rises. */ maxProfit: number | null; /** Null when losses keep growing as the price rises. */ maxLoss: number | null; } /** The payoff curve across a price range, its breakevens, and its best and worst outcomes. */ export declare function payoffSummary(legs: readonly PayoffLeg[], multiplier: number, range: readonly [number, number], samples?: number): PayoffSummary; /** * An options strategy at expiry: profit or loss against where the underlying ends, green above * zero and red below, with today's price and every breakeven marked. The header reads the * outcome at today's price, or wherever the pointer is, beside the best and worst outcomes. */ export declare function PayoffChartCard({ title, header, 'aria-label': ariaLabel, legs, spot, priceRange, multiplier, valueFormat, priceFormat, locale, height, depth, axis, background, hoverStyle, surface, numberStyle, loading, loadingStyle, empty, motion, className, style, }: PayoffChartCardProps): ReactElement;