import { NormalizedRow } from '../engine/normalize'; import { RangeScales } from '../engine/ranges'; /** * How a candle is drawn: a filled `candle`, a `hollow` candle whose rising bodies are outlined * so direction reads without color, or `ohlc` bars with an open tick left and a close tick right. */ export type CandleDisplay = 'candle' | 'hollow' | 'ohlc'; export declare const CANDLE_UP = "var(--lilt-candle-up)"; export declare const CANDLE_DOWN = "var(--lilt-candle-down)"; export interface CandleFields { open: string; high: string; low: string; } export interface Candle { open: number; high: number; low: number; close: number; /** Close at or above open; a flat candle counts as rising. */ up: boolean; } export interface CandlePaths { /** Filled bodies, one path per color. */ bodies: { color: string; d: string; }[]; /** Outlined bodies of hollow rising candles, one path per color. */ hollow: { color: string; d: string; }[]; /** Wicks, and for OHLC bars the whole bar, stroked, one path per color. */ strokes: { color: string; d: string; }[]; /** With depth: the receding side and top of every body, one path per color. */ sides: { color: string; d: string; }[]; tops: { color: string; d: string; }[]; } export declare function candleAt(row: NormalizedRow, series: string, fields: CandleFields): Candle | null; /** Throws on a candle whose high or low does not contain its open and close. */ export declare function assertCandles(rows: readonly NormalizedRow[], series: string, fields: CandleFields): void; interface CandleShape { body: string | null; hollow: string | null; stroke: string; side: string | null; top: string | null; } /** One candle's geometry. Wicks stop at the body, so a hollow body stays empty. */ export declare function candleShape(cx: number, candle: Candle, scales: RangeScales, display: CandleDisplay, depth?: boolean): CandleShape; /** * Every candle in view batched into a handful of paths: bodies, hollow bodies and strokes, * each grouped by color. Thousands of candles stay a few DOM nodes. */ export declare function candlePaths(rows: readonly NormalizedRow[], series: string, fields: CandleFields, scales: RangeScales, display: CandleDisplay, colorOf: (row: NormalizedRow, candle: Candle) => string, depth?: boolean): CandlePaths; export {};