@abdullahjaswal/tickyr-charts 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2971 @@
1
+ import { Accessor } from 'solid-js';
2
+ import { JSX } from 'solid-js';
3
+ import { ParentComponent } from 'solid-js';
4
+
5
+ /** Allocate a Float64-backed buffer using `SharedArrayBuffer` when
6
+ * available, falling back to a regular `Float64Array`. The returned
7
+ * array's `.buffer` is `SharedArrayBuffer` in the fast path; callers
8
+ * that want to be sure should check `.buffer instanceof SharedArrayBuffer`. */
9
+ export declare function allocSharedFloat64(length: number): Float64Array;
10
+
11
+ /** Allocate a Uint32-backed buffer using `SharedArrayBuffer` when
12
+ * available, falling back to a regular `Uint32Array`. */
13
+ export declare function allocSharedUint32(length: number): Uint32Array;
14
+
15
+ declare interface Anchor {
16
+ /** Time in ms since the epoch. */
17
+ t: number;
18
+ /** Price (in the chart's price scale). */
19
+ y: number;
20
+ }
21
+
22
+ /** Apply ARIA attributes to a canvas host element. Idempotent - safe to
23
+ * call on every render. */
24
+ export declare function applyAriaAttributes(el: HTMLElement | undefined, opts: {
25
+ readonly label: string;
26
+ readonly role?: "img" | "figure";
27
+ readonly description?: string;
28
+ }): void;
29
+
30
+ /** Decay velocity by friction `f` over `dtMs`. `f` defaults to 0.95 /
31
+ * 16ms (≈ ~6% per frame). Returns the new velocity. Below `eps`, the
32
+ * caller should stop the animation. */
33
+ export declare function applyInertiaDecay(velocity: number, dtMs: number, friction?: number): number;
34
+
35
+ export declare type AreaBaseline = "zero" | "first-value" | "last-value" | "min" | "max" | "mean" | "average" | "median" | number | ((window: Float64Array) => number);
36
+
37
+ export declare function AreaChart(props: AreaChartProps): JSX.Element;
38
+
39
+ export declare interface AreaChartProps extends Omit<LineChartProps, "areaFill"> {
40
+ baseline?: AreaBaseline;
41
+ fillType?: AreaFillType;
42
+ fillOpacity?: number;
43
+ thresholdFill?: ThresholdFill;
44
+ stacked?: StackingMode;
45
+ }
46
+
47
+ /** Area-fill configuration. AreaChart sets this; LineChart renders it as a
48
+ * polygon between the line and a horizontal `baseline` y-value. Internal -
49
+ * LineChart's public surface intentionally has no area fill (that's
50
+ * <AreaChart>'s defining feature). Reused via `<AreaChart>` which forwards this transparently. */
51
+ declare interface AreaFillConfig {
52
+ baseline: AreaBaseline;
53
+ fillType: "flat" | "gradient";
54
+ fillOpacity: number;
55
+ /** Optional threshold split. When set, the area fill renders as two
56
+ * polygons (above + below threshold) and the line stroke is split too.
57
+ * Mutually exclusive with `stacked`; when
58
+ * both are set, `stacked` wins (threshold becomes a no-op). */
59
+ threshold?: AreaFillThreshold;
60
+ /** Multi-series stacking mode. Resolved form (AreaChart maps user-facing
61
+ * `false | true | 'normalized'` to `false | 'additive' | 'normalized'`).
62
+ * - `false` (default): non-stacked. With 2+ series, each band fills
63
+ * independently from the resolved baseline (overlapping fills).
64
+ * - `'additive'`: bands stack, total = sum at each x.
65
+ * - `'normalized'`: bands stack, total = 1 (100%) at each x. */
66
+ stacked?: false | "additive" | "normalized";
67
+ }
68
+
69
+ declare interface AreaFillThreshold {
70
+ /** Domain-space y to split at. `undefined` → use the resolved baseline. */
71
+ readonly value: number | undefined;
72
+ /** Pre-resolved CSS rgba string for above-threshold runs. */
73
+ readonly aboveColor: string;
74
+ /** Pre-resolved CSS rgba string for below-threshold runs. */
75
+ readonly belowColor: string;
76
+ }
77
+
78
+ export declare type AreaFillType = "flat" | "gradient";
79
+
80
+ declare interface AtrSpecInput extends IndicatorPaneCommon {
81
+ type: "atr";
82
+ period?: number;
83
+ }
84
+
85
+ export declare const AUTO_OPACITY_THRESHOLDS: ReadonlyArray<{
86
+ readonly count: number;
87
+ readonly opacity: number;
88
+ }>;
89
+
90
+ export declare type AxisLabelsMode = "both" | "x-only" | "y-only" | "none";
91
+
92
+ export declare function BarChart(props: BarChartProps): JSX.Element;
93
+
94
+ export declare interface BarChartProps {
95
+ data?: BarChartSeriesInput;
96
+ series?: readonly BarSeriesConfig[];
97
+ grouping?: BarGrouping;
98
+ groupPadding?: number;
99
+ orientation?: Orientation;
100
+ valueLabels?: ValueLabels;
101
+ legend?: LegendVisibility;
102
+ legendPosition?: LegendPosition;
103
+ crosshairVisible?: boolean;
104
+ crosshairLineStyle?: GridStyle;
105
+ crosshairMarker?: CrosshairMarker;
106
+ tooltip?: BarChartTooltipProp;
107
+ width?: number;
108
+ height?: number;
109
+ theme?: ThemeInput;
110
+ palette?: string;
111
+ visualStyle?: "Fill" | "Outline";
112
+ outlineFillColor?: "auto" | string;
113
+ outlineFillOpacity?: number;
114
+ pixelDensityCap?: number;
115
+ fastMode?: boolean;
116
+ sparkline?: boolean;
117
+ ariaLabel?: string;
118
+ axisVisible?: boolean;
119
+ yAxisPosition?: YAxisPosition;
120
+ xAxisPosition?: XAxisPosition;
121
+ yAxisPadding?: number;
122
+ gridVisible?: boolean;
123
+ gridStyle?: GridStyle;
124
+ gridDensity?: "sparse" | "normal" | "dense";
125
+ accents?: boolean;
126
+ locale?: string;
127
+ timeZone?: string;
128
+ barWidthRatio?: number;
129
+ cornerRadius?: number;
130
+ borderWidth?: number;
131
+ digitGrouping?: DigitGrouping;
132
+ numberAbbreviation?: NumberAbbreviation;
133
+ decimalPlaces?: DecimalPlaces;
134
+ currency?: string;
135
+ currencyDisplay?: CurrencyDisplay;
136
+ percentPrecision?: PercentPrecision;
137
+ dateFormat?: DateFormat;
138
+ timeFormat?: TimeFormat;
139
+ }
140
+
141
+ export declare type BarChartSeriesInput = LineSeriesInput;
142
+
143
+ export declare type BarChartTooltipProp = undefined | false | ((props: BarChartTooltipProps) => JSX.Element);
144
+
145
+ export declare interface BarChartTooltipProps {
146
+ readonly t: number;
147
+ readonly idx: number;
148
+ readonly seriesValues: readonly BarTooltipSeriesValue[];
149
+ readonly pointerX: number;
150
+ readonly pointerY: number;
151
+ readonly containerWidth: number;
152
+ readonly containerHeight: number;
153
+ readonly theme: Theme;
154
+ readonly palette: Palette;
155
+ readonly locale: string;
156
+ readonly timeZone: string | undefined;
157
+ readonly formatter: ChartFormatter;
158
+ }
159
+
160
+ declare type BarEntryAnimation = "none" | "spring" | "fade" | "fade-stagger-left" | "fade-stagger-right" | "grow-from-baseline" | "rise-from-low" | "slide-from-right" | "slide-from-top" | "scale" | "expand-x" | "wave" | "wipe" | "random-fade";
161
+
162
+ export declare type BarGrouping = "clustered" | "stacked" | "normalized" | "overlapping";
163
+
164
+ export declare interface BarSeriesConfig {
165
+ readonly id: string;
166
+ readonly data: BarChartSeriesInput;
167
+ readonly label?: string;
168
+ readonly color?: string;
169
+ }
170
+
171
+ export declare interface BarTooltipSeriesValue {
172
+ readonly id: string;
173
+ readonly label: string;
174
+ readonly color: string;
175
+ readonly value: number;
176
+ }
177
+
178
+ declare type BarUpdateAnimation = "none" | "morph + flash-direction" | "morph" | "flash-neutral" | "flash-direction" | "pulse" | "glow" | "tick-line" | "flicker" | "rise";
179
+
180
+ /** Common props every tooltip in the lib receives. Chart-specific
181
+ * tooltips extend this with their `target` payload (hovered point,
182
+ * candle, slice, etc.). */
183
+ export declare interface BaseTooltipProps {
184
+ /** Pointer position relative to the chart container, CSS px. */
185
+ readonly pointerX: number;
186
+ readonly pointerY: number;
187
+ /** Container dimensions, CSS px. */
188
+ readonly containerWidth: number;
189
+ readonly containerHeight: number;
190
+ /** Active theme + palette at the time of hover. */
191
+ readonly theme: Theme;
192
+ readonly palette: Palette;
193
+ /** Active locale + timezone for value formatting. */
194
+ readonly locale: string;
195
+ readonly timeZone: string | undefined;
196
+ }
197
+
198
+ export declare type BinAlgorithm = "sturges" | "freedman-diaconis" | "scott" | "fixed";
199
+
200
+ declare interface BinaryCandleSeriesInput {
201
+ times: Float64Array;
202
+ opens: Float64Array;
203
+ highs: Float64Array;
204
+ lows: Float64Array;
205
+ closes: Float64Array;
206
+ volumes?: Float64Array;
207
+ }
208
+
209
+ export declare type BoxSizingInput = number | `atr-${number}` | `percent-${number}` | {
210
+ readonly type: "fixed";
211
+ readonly value: number;
212
+ } | {
213
+ readonly type: "atr";
214
+ readonly period: number;
215
+ } | {
216
+ readonly type: "percent";
217
+ readonly value: number;
218
+ };
219
+
220
+ /** Accept brand input as OKLCH or hex string. */
221
+ export declare type BrandInput = Oklch | string;
222
+
223
+ export declare type BubbleScale = "linear" | "sqrt";
224
+
225
+ export declare const BULK_BAR_THRESHOLD = 5000;
226
+
227
+ declare interface Candle {
228
+ t: number;
229
+ o: number;
230
+ h: number;
231
+ l: number;
232
+ c: number;
233
+ v?: number;
234
+ }
235
+
236
+ export declare function CandleChart(props: CandleChartProps): JSX.Element;
237
+
238
+ /** Imperative handle exposed via `ref` on `<CandleChart>`. Binary
239
+ * data ingestion - primitive args. */
240
+ declare interface CandleChartHandle {
241
+ /** Push a live tick. Updates high/low/close of the most recent bar
242
+ * in-place; the host owns bar progression (call `update({ data })`
243
+ * with a fresh last bar to start a new bucket). */
244
+ onTick(time: number, price: number, size?: number): void;
245
+ }
246
+
247
+ export declare interface CandleChartProps {
248
+ /** Solid ref callback - receives the imperative handle after mount. */
249
+ ref?: (handle: CandleChartHandle) => void;
250
+ data: CandleSeriesInput;
251
+ historyData?: CandleSeriesInput;
252
+ width?: number;
253
+ height?: number;
254
+ theme?: ThemeInput;
255
+ palette?: string;
256
+ visualStyle?: "Fill" | "Outline";
257
+ outlineFillColor?: "auto" | string;
258
+ outlineFillOpacity?: number;
259
+ cornerRadius?: number;
260
+ borderWidth?: number;
261
+ pixelDensityCap?: number;
262
+ fastMode?: boolean;
263
+ sparkline?: boolean;
264
+ ariaLabel?: string;
265
+ candleType?: CandleType;
266
+ bodyWidthRatio?: number;
267
+ wickWidth?: number;
268
+ wickColor?: WickColor;
269
+ dojiMinBodyHeight?: number;
270
+ axisVisible?: boolean;
271
+ yAxisPosition?: YAxisPosition;
272
+ xAxisPosition?: XAxisPosition;
273
+ yAxisPadding?: number;
274
+ gridVisible?: boolean;
275
+ gridStyle?: GridStyle;
276
+ gridDensity?: "sparse" | "normal" | "dense";
277
+ accents?: boolean;
278
+ locale?: string;
279
+ timeZone?: string;
280
+ crosshairVisible?: boolean;
281
+ crosshairLineStyle?: GridStyle;
282
+ crosshairMarker?: CrosshairMarker;
283
+ crosshairPaneSync?: boolean;
284
+ tooltip?: CandleChartTooltipProp;
285
+ digitGrouping?: DigitGrouping;
286
+ numberAbbreviation?: NumberAbbreviation;
287
+ decimalPlaces?: DecimalPlaces;
288
+ currency?: string;
289
+ currencyDisplay?: CurrencyDisplay;
290
+ percentPrecision?: PercentPrecision;
291
+ dateFormat?: DateFormat;
292
+ timeFormat?: TimeFormat;
293
+ lastPriceLine?: LastPriceLineStyle;
294
+ lastPriceLabel?: boolean;
295
+ highLowMarkers?: HighLowMarkers;
296
+ extremeTooltip?: ExtremeTooltipProp;
297
+ volumeVisible?: boolean;
298
+ volumePlacement?: VolumePlacement;
299
+ volumeColoring?: VolumeColoring;
300
+ volumeSingleColor?: "auto" | string;
301
+ volumeScale?: VolumeScale;
302
+ volumeHeightRatio?: number;
303
+ volumeBarTooltip?: boolean | ((props: VolumeBarTooltipProps) => JSX.Element);
304
+ indicators?: readonly IndicatorPaneSpec[];
305
+ indicatorLineWidth?: number;
306
+ indicatorLineStyle?: IndicatorLineStyle;
307
+ indicatorOpacity?: number;
308
+ liveBarIndicator?: LiveBarIndicator;
309
+ connectionIndicator?: ConnectionIndicator;
310
+ liveSince?: number;
311
+ connectionState?: LiveState;
312
+ staleThreshold?: number;
313
+ staleVisualization?: StaleVisualization;
314
+ staleBanner?: boolean | ((p: {
315
+ state: LiveState;
316
+ liveSince: number | undefined;
317
+ theme: Theme;
318
+ palette: Palette;
319
+ }) => JSX.Element);
320
+ legendPosition?: LegendPosition;
321
+ reducedMotion?: boolean;
322
+ barEntryAnimation?: BarEntryAnimation;
323
+ barUpdateAnimation?: BarUpdateAnimation;
324
+ drawings?: readonly Drawing[];
325
+ signals?: readonly SignalMarker[];
326
+ orders?: readonly OrderMarker[];
327
+ position?: PositionMarker;
328
+ events?: readonly EventMarker[];
329
+ signalTooltip?: false | ((p: SignalTooltipProps) => JSX.Element);
330
+ orderTooltip?: false | ((p: OrderTooltipProps) => JSX.Element);
331
+ positionTooltip?: false | ((p: PositionTooltipProps) => JSX.Element);
332
+ eventTooltip?: false | ((p: EventTooltipProps) => JSX.Element);
333
+ }
334
+
335
+ export declare type CandleChartTooltipProp = undefined | false | ((props: CandleChartTooltipProps) => JSX.Element);
336
+
337
+ /** Props passed to a custom CandleChart OHLC tooltip render function (and
338
+ * to the built-in `DefaultCandleTooltip`). Framework-agnostic data shape. */
339
+ export declare interface CandleChartTooltipProps {
340
+ /** Time at the active hover position (unix-ms). */
341
+ t: number;
342
+ /** Bar index in the candle series (0-based). */
343
+ idx: number;
344
+ /** Open / High / Low / Close at the hover bar. For Heikin-Ashi mode
345
+ * these are the HA-transformed values (what the chart is actually
346
+ * rendering); the tooltip stays consistent with what's on screen. */
347
+ o: number;
348
+ h: number;
349
+ l: number;
350
+ c: number;
351
+ /** Direction at hover - `'up'` if `c >= o`, `'down'` if `c < o`,
352
+ * `'doji'` if the body collapsed below the floor and rendered with
353
+ * `palette.doji`. */
354
+ direction: CandleDirection;
355
+ /** Pointer position in CSS pixels relative to the chart container. */
356
+ pointerX: number;
357
+ pointerY: number;
358
+ /** Container dimensions for placement decisions. */
359
+ containerWidth: number;
360
+ containerHeight: number;
361
+ theme: Theme;
362
+ palette: Palette;
363
+ locale: string;
364
+ timeZone: string | undefined;
365
+ formatter: ChartFormatter;
366
+ }
367
+
368
+ /** Direction signal for the OHLC bar at hover. `'doji'` when the
369
+ * source-data |O−C| would render below `dojiMinBodyHeight` and the chart
370
+ * is showing the doji floor in `palette.doji`. */
371
+ export declare type CandleDirection = "up" | "down" | "doji";
372
+
373
+ declare type CandleSeriesInput = {
374
+ candles: readonly Candle[];
375
+ } | BinaryCandleSeriesInput;
376
+
377
+ export declare type CandleType = "solid" | "heikin-ashi" | "ohlc-bars";
378
+
379
+ export declare type CellShape = "rect" | "circle";
380
+
381
+ export declare type CenterLabelProp = false | true | string | ((data: DonutCenterLabelData) => JSX.Element);
382
+
383
+ declare class ChartFormatter {
384
+ private readonly opt;
385
+ private readonly resolvedAbbrev;
386
+ private readonly intlCache;
387
+ private readonly dateFmt;
388
+ private readonly timeFmt;
389
+ constructor(opt: ChartFormatterOptions);
390
+ private intlFor;
391
+ formatNumber(n: number, decimalsOverride?: number): string;
392
+ formatPrice(n: number, decimalsOverride?: number): string;
393
+ formatPercent(fraction: number, precisionOverride?: number): string;
394
+ formatDate(t: number): string;
395
+ formatTime(t: number): string;
396
+ private buildDateFmt;
397
+ private buildTimeFmt;
398
+ }
399
+
400
+ declare interface ChartFormatterOptions {
401
+ readonly locale: ResolvedLocale;
402
+ readonly digitGrouping: DigitGrouping;
403
+ readonly numberAbbreviation: NumberAbbreviation;
404
+ readonly decimalPlaces: DecimalPlaces;
405
+ readonly currency: string;
406
+ readonly currencyDisplay: CurrencyDisplay;
407
+ readonly percentPrecision: PercentPrecision;
408
+ readonly dateFormat: DateFormat;
409
+ readonly timeFormat: TimeFormat;
410
+ readonly timeZone?: string | undefined;
411
+ }
412
+
413
+ export declare function ChartGroup(props: ChartGroupProps): JSX.Element;
414
+
415
+ export declare function ChartGroupBrush(props: ChartGroupBrushProps): JSX.Element;
416
+
417
+ export declare interface ChartGroupBrushProps {
418
+ readonly domain: {
419
+ start: number;
420
+ end: number;
421
+ };
422
+ readonly width?: number;
423
+ readonly height?: number;
424
+ readonly trackColor?: string;
425
+ readonly selectionColor?: string;
426
+ readonly handleColor?: string;
427
+ }
428
+
429
+ declare interface ChartGroupContextValue {
430
+ readonly options: () => ChartGroupOptions;
431
+ readonly state: ChartGroupState;
432
+ readonly version: () => number;
433
+ }
434
+
435
+ export declare function ChartGroupNavigator(props: ChartGroupNavigatorProps): JSX.Element;
436
+
437
+ export declare interface ChartGroupNavigatorProps {
438
+ readonly data: LineSeriesInput;
439
+ readonly domain?: {
440
+ start: number;
441
+ end: number;
442
+ };
443
+ readonly width?: number;
444
+ readonly height?: number;
445
+ }
446
+
447
+ export declare interface ChartGroupOptions {
448
+ /** Sync the visible x-domain across the group. */
449
+ readonly syncDomain: boolean;
450
+ readonly syncPanZoom: boolean;
451
+ readonly syncCrosshair: boolean;
452
+ readonly syncYScale: SyncYScale;
453
+ readonly referencePoint: ReferencePoint;
454
+ readonly syncSelection: boolean;
455
+ readonly syncTooltip: boolean;
456
+ /** Whether the group enables a brushable time-range selection. The
457
+ * separate `<ChartGroupBrush>` component reads + writes this state. */
458
+ readonly brush: boolean;
459
+ /** Whether a `<ChartGroupNavigator>` minimap should engage. */
460
+ readonly navigator: boolean;
461
+ }
462
+
463
+ export declare interface ChartGroupProps extends Partial<ChartGroupOptions> {
464
+ children?: JSX.Element;
465
+ onSelectionChange?: (time: number | null) => void;
466
+ onBrushChange?: (range: TimeRange | null) => void;
467
+ onPaneResize?: (heights: readonly number[]) => void;
468
+ }
469
+
470
+ export declare interface ChartGroupState {
471
+ /** Last hover-position time observed in any sibling chart. */
472
+ readonly crosshairTime: number | null;
473
+ setCrosshairTime(t: number | null): void;
474
+ /** Last click-selection time. */
475
+ readonly selectedTime: number | null;
476
+ setSelectedTime(t: number | null): void;
477
+ /** Shared visible time-range when `syncDomain: true`. */
478
+ readonly domain: TimeRange | null;
479
+ setDomain(d: TimeRange | null): void;
480
+ /** Shared brush range. */
481
+ readonly brush: TimeRange | null;
482
+ setBrush(b: TimeRange | null): void;
483
+ /** Subscribe to any state change. Returns idempotent unsubscriber. */
484
+ subscribe(listener: () => void): () => void;
485
+ }
486
+
487
+ export declare type ChartKind = "line" | "area" | "candle" | "bar" | "renko" | "kagi" | "pnf" | "pie" | "donut" | "treemap" | "sunburst" | "heatmap" | "histogram" | "scatter" | "depth" | "sankey";
488
+
489
+ export declare const ChartsProvider: ParentComponent<ChartsProviderProps>;
490
+
491
+ export declare interface ChartsProviderProps {
492
+ theme?: ThemeInput;
493
+ palette?: string;
494
+ locale?: string;
495
+ timeZone?: string;
496
+ visualStyle?: VisualStyle;
497
+ outlineFillColor?: "auto" | string;
498
+ outlineFillOpacity?: number;
499
+ cornerRadius?: number;
500
+ borderWidth?: number;
501
+ accents?: boolean;
502
+ osTheme?: Theme;
503
+ appTheme?: Theme;
504
+ /** Host-supplied custom palettes. */
505
+ palettes?: readonly Palette[];
506
+ children?: JSX.Element;
507
+ }
508
+
509
+ export declare interface ChartsProviderValue {
510
+ theme: ThemeInput;
511
+ palette: string;
512
+ locale: string;
513
+ timeZone: string | undefined;
514
+ visualStyle: VisualStyle;
515
+ outlineFillColor: "auto" | string;
516
+ outlineFillOpacity: number;
517
+ cornerRadius: number;
518
+ borderWidth: number;
519
+ accents: boolean;
520
+ osTheme: Theme;
521
+ appTheme: Theme;
522
+ }
523
+
524
+ /** Drop every cached offscreen surface. Hosts call this on
525
+ * `onLowMemory` / `didReceiveMemoryWarning`. */
526
+ export declare function clearGlowPool(): void;
527
+
528
+ /** Compile + link a shader program with try/catch - returns `null` on
529
+ * failure so the caller can fall back to canvas2d. */
530
+ export declare function compileShaderProgram(gl: WebGL2RenderingContext, vsSource: string, fsSource: string): WebGLProgram | null;
531
+
532
+ /** Connection-indicator modes. */
533
+ declare type ConnectionIndicator = "off" | "dot" | "pill";
534
+
535
+ export declare type ConnectionIndicatorProp = ConnectionIndicator | ((props: ConnectionIndicatorRenderProps) => JSX.Element);
536
+
537
+ export declare interface ConnectionIndicatorRenderProps {
538
+ state: LiveState;
539
+ liveSince: number | undefined;
540
+ position: LegendPosition;
541
+ theme: Theme;
542
+ palette: Palette;
543
+ }
544
+
545
+ declare type CrosshairMarker = "none" | "circle" | "square";
546
+
547
+ export declare type CrosshairMode = "follow" | "sticky";
548
+
549
+ export declare type CrosshairSnap = "free" | "x-axis" | "data";
550
+
551
+ declare type CurrencyDisplay = "none" | "symbol" | "code";
552
+
553
+ export declare type CurveType = CurveTypeName | CurveTypeConfig;
554
+
555
+ export declare interface CurveTypeConfig {
556
+ readonly type: CurveTypeName;
557
+ /** 0–1 - only honored for `cardinal`. Default 0. Higher = looser curve. */
558
+ readonly tension?: number;
559
+ /** 0–1 - only honored for `catmull-rom`. Default 0.5 (centripetal). */
560
+ readonly alpha?: number;
561
+ }
562
+
563
+ export declare type CurveTypeName = "linear" | "monotone" | "monotone-x" | "monotone-y" | "step" | "step-before" | "step-after" | "bump" | "bump-x" | "bump-y" | "natural" | "basis" | "cardinal" | "catmull-rom";
564
+
565
+ declare type DateFormat = "auto" | "short" | "medium" | "iso";
566
+
567
+ declare type DecimalPlaces = "auto" | number;
568
+
569
+ export declare const DEFAULT_AXIS_LABELS: AxisLabelsMode;
570
+
571
+ export declare const DEFAULT_BIN_ALGORITHM: BinAlgorithm;
572
+
573
+ export declare const DEFAULT_BOX_SIZING: ResolvedBoxSizing;
574
+
575
+ export declare const DEFAULT_BUBBLE_RANGE_PX: readonly [number, number];
576
+
577
+ export declare const DEFAULT_CELL_SHAPE: CellShape;
578
+
579
+ export declare const DEFAULT_DEPTH_FILL_TYPE: DepthFillType;
580
+
581
+ export declare const DEFAULT_GLOW: GlowInput;
582
+
583
+ export declare const DEFAULT_GLOW_COLOR: GlowColorInput;
584
+
585
+ export declare const DEFAULT_GPU_RENDERER: GpuRendererInput;
586
+
587
+ export declare const DEFAULT_HEATMAP_COLOR_SCALE: HeatmapColorScaleType;
588
+
589
+ export declare const DEFAULT_KAGI_THICKNESS_RULE: KagiThicknessRule;
590
+
591
+ export declare const DEFAULT_LABEL_BEHAVIOR: LabelBehavior;
592
+
593
+ export declare const DEFAULT_LABEL_CONTENT: LabelContentPreset;
594
+
595
+ export declare const DEFAULT_LABEL_PLACEMENT: LabelPlacement;
596
+
597
+ export declare const DEFAULT_LABEL_ROTATION: LabelRotation;
598
+
599
+ export declare const DEFAULT_LONG_PRESS_BEHAVIOR: LongPressBehavior;
600
+
601
+ export declare const DEFAULT_NULL_BEHAVIOR: NullBehavior;
602
+
603
+ export declare const DEFAULT_NUMBER_FORMAT: NumberFormatPreset;
604
+
605
+ export declare const DEFAULT_PAN_ZOOM_OPTIONS: PanZoomOptions;
606
+
607
+ export declare const DEFAULT_PATTERN: PatternInput;
608
+
609
+ export declare const DEFAULT_PATTERN_COLOR: PatternColorInput;
610
+
611
+ export declare const DEFAULT_PATTERN_SCALE = 1;
612
+
613
+ export declare const DEFAULT_PNF_SYMBOL_STYLE: PnFSymbolStyle;
614
+
615
+ export declare const DEFAULT_POINT_SIZE_PX = 9;
616
+
617
+ export declare const DEFAULT_PRICE_RANGE_PCT = 0.05;
618
+
619
+ export declare const DEFAULT_RADIUS_PROPORTION: RadiusProportion;
620
+
621
+ export declare const DEFAULT_SORT_ORDER: SortOrder;
622
+
623
+ export declare const DEFAULT_SPREAD_DISPLAY: SpreadDisplayMode;
624
+
625
+ export declare const DEFAULT_TILE_LAYOUT: TileLayout;
626
+
627
+ export declare const DEFAULT_TIME_OFF_SOURCE: TimeOffSource;
628
+
629
+ export declare const DEFAULT_TREEMAP_COLOR_SCALE: TreemapColorScale;
630
+
631
+ export declare const DEFAULT_VIEW_MODE: ViewMode;
632
+
633
+ export declare const DEFAULT_Y_AXIS_MODE: YAxisMode;
634
+
635
+ /** Default `aria-label` template. Concise + readable; hosts
636
+ * override via `ariaLabel` prop when they have more context. */
637
+ export declare function defaultAriaLabel(opts: {
638
+ readonly kind: ChartKind;
639
+ readonly seriesCount?: number;
640
+ readonly markCount?: number;
641
+ readonly symbol?: string;
642
+ }): string;
643
+
644
+ export declare function DefaultCandleTooltip(props: CandleChartTooltipProps): JSX.Element;
645
+
646
+ export declare function DefaultExtremeTooltip(p: ExtremeTooltipProps): JSX.Element;
647
+
648
+ export declare function DefaultTooltip(props: LineChartTooltipProps): JSX.Element;
649
+
650
+ export declare function DefaultVolumeBarTooltip(props: VolumeBarTooltipProps): JSX.Element;
651
+
652
+ export declare const DENSITY_AUTO_THRESHOLD = 50000;
653
+
654
+ export declare type DensityInput = "off" | "auto" | "on";
655
+
656
+ export declare type DensityRenderMode = "points" | "heatmap";
657
+
658
+ export declare function DepthChart(props: DepthChartProps): JSX.Element;
659
+
660
+ declare interface DepthChartBaseProps {
661
+ /** Orderbook data - bids + asks parallel typed arrays. */
662
+ data?: DepthSeriesInput;
663
+ /** Default 'auto' (±5%). */
664
+ priceRange?: PriceRangeInput;
665
+ /** Default true (solid neutral line). */
666
+ midLine?: MidLineInput;
667
+ /** Default 'pill'. */
668
+ spreadDisplay?: SpreadDisplayInput;
669
+ /** Default true. */
670
+ cumulative?: boolean;
671
+ /** Default 'gradient'. */
672
+ fillType?: DepthFillType;
673
+ /** Default false. */
674
+ levelHighlight?: LevelHighlightInput;
675
+ /** Per-level data for `levelHighlight` - host-supplied. */
676
+ highlightLevels?: ReadonlyArray<{
677
+ readonly price: number;
678
+ readonly label?: string;
679
+ }>;
680
+ legend?: LegendVisibility;
681
+ legendPosition?: LegendPosition;
682
+ crosshairVisible?: boolean;
683
+ crosshairLineStyle?: GridStyle;
684
+ crosshairMarker?: CrosshairMarker;
685
+ width?: number;
686
+ height?: number;
687
+ theme?: ThemeInput;
688
+ palette?: string;
689
+ visualStyle?: "Fill" | "Outline";
690
+ outlineFillColor?: "auto" | string;
691
+ outlineFillOpacity?: number;
692
+ pixelDensityCap?: number;
693
+ fastMode?: boolean;
694
+ /** Glow + glow-color axes. */
695
+ glow?: GlowInput;
696
+ glowColor?: GlowColorInput;
697
+ /** Pattern fills. */
698
+ pattern?: PatternInput;
699
+ patternScale?: number;
700
+ patternColor?: PatternColorInput;
701
+ ariaLabel?: string;
702
+ axisVisible?: boolean;
703
+ yAxisPosition?: YAxisPosition;
704
+ xAxisPosition?: XAxisPosition;
705
+ yAxisPadding?: number;
706
+ gridVisible?: boolean;
707
+ gridStyle?: GridStyle;
708
+ gridDensity?: "sparse" | "normal" | "dense";
709
+ accents?: boolean;
710
+ locale?: string;
711
+ timeZone?: string;
712
+ digitGrouping?: DigitGrouping;
713
+ numberAbbreviation?: NumberAbbreviation;
714
+ decimalPlaces?: DecimalPlaces;
715
+ currency?: string;
716
+ currencyDisplay?: CurrencyDisplay;
717
+ percentPrecision?: PercentPrecision;
718
+ dateFormat?: DateFormat;
719
+ timeFormat?: TimeFormat;
720
+ }
721
+
722
+ export declare interface DepthChartProps extends DepthChartBaseProps {
723
+ tooltip?: DepthChartTooltipProp;
724
+ }
725
+
726
+ export declare type DepthChartTooltipProp = undefined | false | ((props: DepthChartTooltipProps) => JSX.Element);
727
+
728
+ export declare interface DepthChartTooltipProps {
729
+ /** Which side the cursor is over. */
730
+ readonly side: "bid" | "ask";
731
+ /** Price at the cursor's x. */
732
+ readonly price: number;
733
+ /** Cumulative volume at that price (the chart's y value). */
734
+ readonly cumulativeVolume: number;
735
+ /** Distance from the mid price as a fraction (e.g. -0.025 = 2.5% below mid). */
736
+ readonly pctFromMid: number;
737
+ readonly pointerX: number;
738
+ readonly pointerY: number;
739
+ readonly containerWidth: number;
740
+ readonly containerHeight: number;
741
+ readonly theme: Theme;
742
+ readonly palette: Palette;
743
+ readonly locale: string;
744
+ readonly timeZone: string | undefined;
745
+ readonly formatter: ChartFormatter;
746
+ }
747
+
748
+ export declare type DepthFillType = "flat" | "gradient";
749
+
750
+ export declare interface DepthLevel {
751
+ readonly price: number;
752
+ readonly size: number;
753
+ }
754
+
755
+ export declare type DepthLimitInput = number | "all";
756
+
757
+ export declare interface DepthSeriesInput {
758
+ readonly bids: readonly DepthLevel[] | {
759
+ readonly prices: Float64Array;
760
+ readonly sizes: Float64Array;
761
+ };
762
+ readonly asks: readonly DepthLevel[] | {
763
+ readonly prices: Float64Array;
764
+ readonly sizes: Float64Array;
765
+ };
766
+ }
767
+
768
+ /** Generate the chart-chrome accent tint. Per the built-ins, the accent
769
+ * is a desaturated version of the brand pulled toward neutral so it
770
+ * reads as "muted ink" against the chart background while still
771
+ * carrying the brand hue. */
772
+ export declare function deriveAccentTint(brand: BrandInput): Oklch;
773
+
774
+ /** Generate `n` categorical colors by rotating hue around the brand.
775
+ * The brand color sits at slot 0; subsequent slots step `360 / n`
776
+ * degrees around the OKLCH hue wheel while preserving the brand's L
777
+ * and C. Palettes are expected to define a usable
778
+ * categorical array (used by multi-series, pie/donut, treemap, etc.).
779
+ *
780
+ * Tunable count - defaults to 8 which matches the built-in palettes. */
781
+ export declare function deriveCategoricalSet(brand: BrandInput, count?: number): readonly Oklch[];
782
+
783
+ export declare function deriveDefaultPalette(brand: BrandInput, opts: DeriveDefaultPaletteOptions): Palette;
784
+
785
+ /** Build a complete `Palette` from a brand color. Generates both
786
+ * `light` and `dark` variants by calling `deriveVariant` twice with
787
+ * theme-tuned L/C. */
788
+ export declare interface DeriveDefaultPaletteOptions {
789
+ readonly name: string;
790
+ readonly tonalSymmetrySide?: TonalSymmetrySide;
791
+ readonly tonalSymmetryFlipInDarkMode?: boolean;
792
+ }
793
+
794
+ /** Build a `PaletteVariant` (one of `light` or `dark`) from a brand
795
+ * color. Uses opinionated L/C tuning matching the built-in
796
+ * Monochrome / Classic / Accessible variants:
797
+ * - Light theme - up/down at L ≈ 0.70, C ≈ 0.18.
798
+ * - Dark theme - brightened L ≈ 0.78, C ≈ 0.20 for AA contrast.
799
+ * Hue derives from the brand. Categorical = 8-step hue rotation. */
800
+ export declare function deriveVariant(brand: BrandInput, theme: "light" | "dark"): PaletteVariant;
801
+
802
+ /** Detect the FastModeContext from `navigator` + `matchMedia`. Safe to
803
+ * call during SSR (returns an empty context). */
804
+ export declare function detectFastModeContext(): FastModeContext;
805
+
806
+ /** Heuristic - when `true`, treat the device as primarily touch
807
+ * (collapses crosshair to pin-on-click, opt-in pinch zoom, etc.). */
808
+ export declare function detectTouchOnly(): boolean;
809
+
810
+ declare type DigitGrouping = "international" | "lakh-crore" | "none";
811
+
812
+ /** Fixed-capacity ring of dirty rects. Caller pushes rects throughout
813
+ * the frame; the consumer calls `flushCoalesced()` to get the merged
814
+ * rect (null when empty). */
815
+ export declare class DirtyRectRing {
816
+ private xs;
817
+ private ys;
818
+ private ws;
819
+ private hs;
820
+ private idx;
821
+ private filled;
822
+ push(x: number, y: number, w: number, h: number): void;
823
+ /** Merge all pending rects into a single bounding box. Resets the
824
+ * ring. Returns `null` when there's nothing pending. */
825
+ flushCoalesced(): Rect | null;
826
+ /** Flush all pending rects into `out` (length = number of rects).
827
+ * The caller owns the array - pass a reused
828
+ * scratch to avoid allocation. Returns count of populated entries.
829
+ * Resets the ring. */
830
+ flushAll(out: Rect[]): number;
831
+ /** Discard any pending rects without producing a flush. */
832
+ clear(): void;
833
+ size(): number;
834
+ }
835
+
836
+ declare interface DivergingConfig {
837
+ readonly type: "diverging";
838
+ /** Value mapped to the neutral mid-point. Default 0. */
839
+ readonly midpoint?: number;
840
+ /** `[low, high]` data range. When omitted, auto-fits to the data's
841
+ * symmetric extent at compute time. */
842
+ readonly domain?: readonly [number, number];
843
+ }
844
+
845
+ export declare interface DonutCenterLabelData {
846
+ readonly totalValue: number;
847
+ readonly formatter: ChartFormatter;
848
+ readonly theme: Theme;
849
+ readonly palette: Palette;
850
+ }
851
+
852
+ export declare function DonutChart(props: DonutChartProps): JSX.Element;
853
+
854
+ export declare interface DonutChartProps extends PieChartProps {
855
+ centerLabel?: CenterLabelProp;
856
+ }
857
+
858
+ export declare type DowngradeLevel = 0 | 1 | 2 | 3;
859
+
860
+ export declare function downgradeOverrides(level: DowngradeLevel): RenderConfigOverrides;
861
+
862
+ declare interface Drawing {
863
+ readonly id: string;
864
+ readonly type: DrawingType;
865
+ /** Anchors in data coordinates. Cardinality varies by type:
866
+ * - 1: horizontal-line (y), vertical-line (t)
867
+ * - 2: trend-line, rectangle, ellipse, arrow, text (single anchor
868
+ * point + style.text), fib-retracement, fib-extension, brush
869
+ * - 3: pitchfork, channel
870
+ * Validation is host-side at construction; the chart trusts the
871
+ * cardinality for the type it sees. */
872
+ readonly anchors: readonly Anchor[];
873
+ readonly style: DrawingStyle;
874
+ /** Optional metadata for host bookkeeping; not used by the chart. */
875
+ readonly meta?: Record<string, unknown>;
876
+ }
877
+
878
+ declare interface DrawingStyle {
879
+ /** Stroke / fill base color (resolved CSS string OR `'auto'` to use
880
+ * the active palette's `drawings.stroke` slot). */
881
+ color?: string | "auto";
882
+ lineWidth?: number;
883
+ lineStyle?: "solid" | "dashed" | "dotted";
884
+ fillOpacity?: number;
885
+ /** Trend-line + arrow only - bool toggles arrowhead at the second
886
+ * anchor. */
887
+ arrowhead?: boolean;
888
+ /** Text-drawing only. */
889
+ text?: string;
890
+ fontSize?: number;
891
+ }
892
+
893
+ declare type DrawingType = "trend-line" | "horizontal-line" | "vertical-line" | "rectangle" | "ellipse" | "arrow" | "text" | "fib-retracement" | "fib-extension" | "pitchfork" | "channel" | "brush";
894
+
895
+ /** Run the glow compositor. When `glow.strength === 0`, this is a thin
896
+ * pass-through that only invokes the sharp pass on the main context. */
897
+ export declare function drawWithGlow(mainCtx: CanvasRenderingContext2D, opts: GlowOptions, draw: GlowDrawCallback): void;
898
+
899
+ declare type EventKind = "earnings" | "dividend" | "split" | "news";
900
+
901
+ declare interface EventMarker {
902
+ t: number;
903
+ kind: EventKind;
904
+ /** Short label (1-2 chars) for the glyph mode. */
905
+ glyph?: string;
906
+ /** Full title for the banner mode. */
907
+ title?: string;
908
+ meta?: Record<string, unknown>;
909
+ }
910
+
911
+ declare interface EventTooltipProps {
912
+ marker: EventMarker;
913
+ pointerX: number;
914
+ pointerY: number;
915
+ formatter: ChartFormatter;
916
+ }
917
+
918
+ export declare type ExtremeTooltipProp = boolean | ((props: ExtremeTooltipProps) => JSX.Element);
919
+
920
+ /** Props passed to a custom extreme-tooltip render function (H/L pill hover).
921
+ * Framework-agnostic data shape - same in both React and Solid. */
922
+ export declare interface ExtremeTooltipProps {
923
+ kind: "high" | "low";
924
+ /** Bar index in the source series. */
925
+ barIdx: number;
926
+ price: number;
927
+ /** Time at the extreme bar (unix-ms). */
928
+ t: number;
929
+ /** Pointer position in CSS pixels relative to the chart container. */
930
+ pointerX: number;
931
+ pointerY: number;
932
+ containerWidth: number;
933
+ containerHeight: number;
934
+ theme: Theme;
935
+ palette: Palette;
936
+ /** Resolved platform locale (e.g. "en-US"). */
937
+ locale: string;
938
+ timeZone: string | undefined;
939
+ formatter: ChartFormatter;
940
+ }
941
+
942
+ export declare interface FastModeContext {
943
+ /** From `navigator.connection.effectiveType` if present. */
944
+ readonly effectiveType?: string;
945
+ /** From `navigator.deviceMemory` (GB). */
946
+ readonly deviceMemory?: number;
947
+ /** From `matchMedia('(prefers-reduced-motion: reduce)').matches`. */
948
+ readonly prefersReducedMotion?: boolean;
949
+ }
950
+
951
+ export declare type FastModeInput = boolean | "auto";
952
+
953
+ export declare class FrameTimeMonitor {
954
+ private buf;
955
+ private idx;
956
+ private filled;
957
+ private level;
958
+ /** Cooldown counter - frames since the last level change. Prevents
959
+ * the monitor from chasing its tail and downgrading multiple levels
960
+ * in successive frames. */
961
+ private cooldown;
962
+ /** Record one frame's duration (ms). Returns the (possibly new) downgrade
963
+ * level. Caller checks against the previous level to decide whether to
964
+ * bust caches / re-render. */
965
+ recordFrame(ms: number): DowngradeLevel;
966
+ /** Current downgrade level (caller reads to apply to render config). */
967
+ currentLevel(): DowngradeLevel;
968
+ reset(): void;
969
+ private computeP95;
970
+ }
971
+
972
+ /** `'auto'` (default) = each mark glows in its own direction color
973
+ * (`up`/`down`/`doji` from the palette). A literal color (any CSS-color
974
+ * string, hex, or `oklch(...)`) overrides for uniform brand glow. */
975
+ export declare type GlowColorInput = "auto" | string;
976
+
977
+ /** Glow-pass draw callback. Called once per pass:
978
+ * - `isGlowPass = true` → the caller draws into `ctx` using the halo
979
+ * color resolver (or a constant color when `glow.color !== 'auto'`).
980
+ * The draw should produce only the *shape mass* of the marks; strokes
981
+ * can be thicker than normal for a fuller aura, but no axis chrome.
982
+ * - `isGlowPass = false` → the caller draws the actual marks normally on
983
+ * top of the glow.
984
+ * The `ctx` is already translated so plot-rect origin maps to (0,0) on
985
+ * glow passes; the caller does not need to re-apply the translate.
986
+ */
987
+ export declare type GlowDrawCallback = (ctx: CanvasRenderingContext2D, isGlowPass: boolean) => void;
988
+
989
+ /** Host-supplied input. Named presets resolve to fixed strengths; numeric
990
+ * values clamp to `[0, 1]`. */
991
+ export declare type GlowInput = GlowPreset | number;
992
+
993
+ export declare interface GlowOptions {
994
+ readonly glow: ResolvedGlow;
995
+ readonly theme: Theme;
996
+ readonly plotRect: GlowPlotRect;
997
+ /** Device-pixel ratio multiplier for the offscreen surface. Passed
998
+ * separately so glow renders crisp on high-DPR displays without
999
+ * forcing the caller to re-apply `setTransform`. */
1000
+ readonly dpr: number;
1001
+ }
1002
+
1003
+ /** Plot-rect (CSS px) - the glow's offscreen surface matches this region
1004
+ * exactly so blur stays clipped to the plot. */
1005
+ export declare interface GlowPlotRect {
1006
+ readonly x: number;
1007
+ readonly y: number;
1008
+ readonly w: number;
1009
+ readonly h: number;
1010
+ }
1011
+
1012
+ export declare type GlowPreset = "off" | "subtle" | "standard" | "intense";
1013
+
1014
+ export declare const GPU_ENGAGE_THRESHOLD = 50000;
1015
+
1016
+ export declare interface GpuEngageContext {
1017
+ /** Visible mark count after downsampling. */
1018
+ readonly visibleMarkCount: number;
1019
+ /** Host-resolved `gpuRenderer`. */
1020
+ readonly gpuRenderer: GpuRendererInput;
1021
+ }
1022
+
1023
+ export declare type GpuRendererInput = "auto" | "on" | "off";
1024
+
1025
+ declare type GridStyle = "solid" | "dashed" | "dotted";
1026
+
1027
+ export declare function HeatmapChart(props: HeatmapChartProps): JSX.Element;
1028
+
1029
+ declare interface HeatmapChartBaseProps {
1030
+ /** Row-major matrix of values to color. See `HeatmapMatrixInput`
1031
+ * for the row labels / col labels / values shape. */
1032
+ data?: HeatmapMatrixInput;
1033
+ /** Default 'diverging'. */
1034
+ colorScale?: HeatmapColorScaleInput;
1035
+ /** Default 2 px (gapUnit). */
1036
+ cellPadding?: number;
1037
+ /** Default 'rect'. */
1038
+ cellShape?: CellShape;
1039
+ /** Default false. true = auto-contrast text per cell. */
1040
+ valueDisplay?: boolean;
1041
+ /** Default 'both'. */
1042
+ axisLabels?: AxisLabelsMode;
1043
+ /** Default 'cross-hatch'. */
1044
+ nullBehavior?: NullBehavior;
1045
+ legend?: LegendVisibility;
1046
+ legendPosition?: LegendPosition;
1047
+ crosshairVisible?: boolean;
1048
+ crosshairLineStyle?: GridStyle;
1049
+ crosshairMarker?: CrosshairMarker;
1050
+ width?: number;
1051
+ height?: number;
1052
+ theme?: ThemeInput;
1053
+ palette?: string;
1054
+ visualStyle?: "Fill" | "Outline";
1055
+ outlineFillColor?: "auto" | string;
1056
+ outlineFillOpacity?: number;
1057
+ pixelDensityCap?: number;
1058
+ fastMode?: boolean;
1059
+ /** Glow + glow-color axes. */
1060
+ glow?: GlowInput;
1061
+ glowColor?: GlowColorInput;
1062
+ /** Pattern fills. */
1063
+ pattern?: PatternInput;
1064
+ patternScale?: number;
1065
+ patternColor?: PatternColorInput;
1066
+ ariaLabel?: string;
1067
+ accents?: boolean;
1068
+ locale?: string;
1069
+ timeZone?: string;
1070
+ cornerRadius?: number;
1071
+ borderWidth?: number;
1072
+ digitGrouping?: DigitGrouping;
1073
+ numberAbbreviation?: NumberAbbreviation;
1074
+ decimalPlaces?: DecimalPlaces;
1075
+ currency?: string;
1076
+ currencyDisplay?: CurrencyDisplay;
1077
+ percentPrecision?: PercentPrecision;
1078
+ dateFormat?: DateFormat;
1079
+ timeFormat?: TimeFormat;
1080
+ }
1081
+
1082
+ export declare interface HeatmapChartProps extends HeatmapChartBaseProps {
1083
+ tooltip?: HeatmapChartTooltipProp;
1084
+ }
1085
+
1086
+ export declare type HeatmapChartTooltipProp = undefined | false | ((props: HeatmapChartTooltipProps) => JSX.Element);
1087
+
1088
+ export declare interface HeatmapChartTooltipProps {
1089
+ readonly row: number;
1090
+ readonly col: number;
1091
+ readonly value: number | null;
1092
+ readonly rowLabel: string;
1093
+ readonly colLabel: string;
1094
+ readonly pointerX: number;
1095
+ readonly pointerY: number;
1096
+ readonly containerWidth: number;
1097
+ readonly containerHeight: number;
1098
+ readonly theme: Theme;
1099
+ readonly palette: Palette;
1100
+ readonly locale: string;
1101
+ readonly timeZone: string | undefined;
1102
+ readonly formatter: ChartFormatter;
1103
+ }
1104
+
1105
+ export declare type HeatmapColorScaleInput = HeatmapColorScaleType | DivergingConfig | SequentialConfig | QualitativeConfig;
1106
+
1107
+ export declare type HeatmapColorScaleType = "sequential" | "diverging" | "qualitative";
1108
+
1109
+ declare interface HeatmapMatrixInput {
1110
+ /** Number of rows (y-axis cells). */
1111
+ readonly rows: number;
1112
+ /** Number of columns (x-axis cells). */
1113
+ readonly cols: number;
1114
+ /** Cell values, row-major (`values[r * cols + c]`). Length = rows × cols. */
1115
+ readonly values: Float64Array | readonly number[];
1116
+ /** Optional per-row labels (length = rows). When omitted, row indices. */
1117
+ readonly rowLabels?: readonly string[];
1118
+ /** Optional per-column labels (length = cols). When omitted, column indices. */
1119
+ readonly colLabels?: readonly string[];
1120
+ /** Optional null mask, row-major (`1` = null cell, `0` = value). */
1121
+ readonly nullMask?: Uint8Array | readonly number[];
1122
+ }
1123
+
1124
+ /** Convert a sRGB hex string (`#rrggbb` or `#rgb`) to OKLCH. */
1125
+ export declare function hexToOklch(hex: string): Oklch;
1126
+
1127
+ export declare interface HierarchyNode {
1128
+ readonly name: string;
1129
+ /** Optional explicit value. Internal-node values are always overridden
1130
+ * by the sum of leaf-descendant values (treemap layout invariant). */
1131
+ readonly value?: number;
1132
+ /** Optional CSS color override; auto-cycle through palette.categorical. */
1133
+ readonly color?: string;
1134
+ /** Optional signed percent change (e.g. `-2.2`,
1135
+ * `1.7`). When supplied, drives the `'directional'` color scale + the
1136
+ * `'ticker'` label preset (▲/▼ glyph + magnitude). Internal-node deltas
1137
+ * are computed at ingest time as the value-weighted average of leaf
1138
+ * descendants. */
1139
+ readonly delta?: number;
1140
+ /** Optional secondary line rendered below the name in 'ticker' label
1141
+ * layout (e.g. company name beneath the symbol). */
1142
+ readonly sublabel?: string;
1143
+ readonly children?: readonly HierarchyNode[];
1144
+ }
1145
+
1146
+ /** Marker mode for the visible-window high / low. */
1147
+ export declare type HighLowMarkers = "off" | "lines+labels" | "labels-only";
1148
+
1149
+ export declare function HistogramChart(props: HistogramChartProps): JSX.Element;
1150
+
1151
+ declare interface HistogramChartBaseProps {
1152
+ /** Distribution data - raw values that will be binned by the
1153
+ * configured algorithm. See `HistogramSeriesInput`. */
1154
+ data?: HistogramSeriesInput;
1155
+ /** Default 'freedman-diaconis'. */
1156
+ binAlgorithm?: BinAlgorithm;
1157
+ /** Used when `binAlgorithm: 'fixed'`. */
1158
+ binCount?: number;
1159
+ /** `'auto'` → data min. */
1160
+ binStart?: number | "auto";
1161
+ /** `'auto'` → data max. */
1162
+ binEnd?: number | "auto";
1163
+ /** Default 'frequency'. */
1164
+ yAxis?: YAxisMode;
1165
+ /** Default 1.0 (touching bars). */
1166
+ barWidthRatio?: number;
1167
+ /** Default false. */
1168
+ overlay?: HistogramOverlayInput;
1169
+ legend?: LegendVisibility;
1170
+ legendPosition?: LegendPosition;
1171
+ crosshairVisible?: boolean;
1172
+ crosshairLineStyle?: GridStyle;
1173
+ crosshairMarker?: CrosshairMarker;
1174
+ width?: number;
1175
+ height?: number;
1176
+ theme?: ThemeInput;
1177
+ palette?: string;
1178
+ visualStyle?: "Fill" | "Outline";
1179
+ outlineFillColor?: "auto" | string;
1180
+ outlineFillOpacity?: number;
1181
+ pixelDensityCap?: number;
1182
+ fastMode?: boolean;
1183
+ /** Glow + glow-color axes. */
1184
+ glow?: GlowInput;
1185
+ glowColor?: GlowColorInput;
1186
+ /** Pattern fills. */
1187
+ pattern?: PatternInput;
1188
+ patternScale?: number;
1189
+ patternColor?: PatternColorInput;
1190
+ sparkline?: boolean;
1191
+ ariaLabel?: string;
1192
+ axisVisible?: boolean;
1193
+ yAxisPosition?: YAxisPosition;
1194
+ xAxisPosition?: XAxisPosition;
1195
+ yAxisPadding?: number;
1196
+ gridVisible?: boolean;
1197
+ gridStyle?: GridStyle;
1198
+ gridDensity?: "sparse" | "normal" | "dense";
1199
+ accents?: boolean;
1200
+ locale?: string;
1201
+ timeZone?: string;
1202
+ cornerRadius?: number;
1203
+ borderWidth?: number;
1204
+ digitGrouping?: DigitGrouping;
1205
+ numberAbbreviation?: NumberAbbreviation;
1206
+ decimalPlaces?: DecimalPlaces;
1207
+ currency?: string;
1208
+ currencyDisplay?: CurrencyDisplay;
1209
+ percentPrecision?: PercentPrecision;
1210
+ dateFormat?: DateFormat;
1211
+ timeFormat?: TimeFormat;
1212
+ }
1213
+
1214
+ export declare interface HistogramChartProps extends HistogramChartBaseProps {
1215
+ tooltip?: HistogramChartTooltipProp;
1216
+ }
1217
+
1218
+ export declare type HistogramChartTooltipProp = undefined | false | ((props: HistogramChartTooltipProps) => JSX.Element);
1219
+
1220
+ export declare interface HistogramChartTooltipProps {
1221
+ /** Bin index (0-based). */
1222
+ readonly binIdx: number;
1223
+ /** Lower edge of the bin (data value). */
1224
+ readonly binStart: number;
1225
+ /** Upper edge of the bin (data value). */
1226
+ readonly binEnd: number;
1227
+ /** Raw count in this bin. */
1228
+ readonly count: number;
1229
+ /** Y-value rendered (frequency / density / cumulative). */
1230
+ readonly value: number;
1231
+ readonly pointerX: number;
1232
+ readonly pointerY: number;
1233
+ readonly containerWidth: number;
1234
+ readonly containerHeight: number;
1235
+ readonly theme: Theme;
1236
+ readonly palette: Palette;
1237
+ readonly locale: string;
1238
+ readonly timeZone: string | undefined;
1239
+ readonly formatter: ChartFormatter;
1240
+ }
1241
+
1242
+ export declare type HistogramOverlayInput = false | "normal" | "cumulative-line" | (OverlayStyle & {
1243
+ readonly type: HistogramOverlayType;
1244
+ });
1245
+
1246
+ export declare type HistogramOverlayType = "normal" | "cumulative-line";
1247
+
1248
+ declare type HistogramSeriesInput = {
1249
+ readonly values: Float64Array;
1250
+ } | {
1251
+ readonly values: readonly number[];
1252
+ };
1253
+
1254
+ export declare type IndicatorLineStyle = "solid" | "dashed" | "dotted";
1255
+
1256
+ declare interface IndicatorPaneCommon {
1257
+ /** `'auto'` resolves from `palette.indicators.<type>` at draw time. */
1258
+ color?: "auto" | string;
1259
+ /** Overrides global `indicatorLineWidth`. */
1260
+ lineWidth?: number;
1261
+ /** Overrides global `indicatorLineStyle`. */
1262
+ lineStyle?: IndicatorLineStyle;
1263
+ /** Overrides global `indicatorOpacity`. */
1264
+ opacity?: number;
1265
+ }
1266
+
1267
+ export declare type IndicatorPaneSpec = RsiSpecInput | MacdSpecInput | StochasticSpecInput | AtrSpecInput;
1268
+
1269
+ /** Sentinel - when |velocity| drops below this, stop the loop. */
1270
+ export declare const INERTIA_EPSILON = 0.01;
1271
+
1272
+ /** Translate a `KeyboardEvent.key` into an intent. Returns `null` when
1273
+ * the key isn't bound (caller passes through). */
1274
+ export declare function intentFromKey(key: string): KeyboardIntent | null;
1275
+
1276
+ /** Is `SharedArrayBuffer` available + the page is cross-origin-isolated? */
1277
+ export declare function isSharedMemoryAvailable(): boolean;
1278
+
1279
+ /** Cheap probe - returns true if `WebGL2RenderingContext` exists in the
1280
+ * current realm. Doesn't actually allocate a context. */
1281
+ export declare function isWebgl2Available(): boolean;
1282
+
1283
+ export declare function KagiChart(props: KagiChartProps): JSX.Element;
1284
+
1285
+ declare interface KagiChartBaseProps {
1286
+ /** Required OHLC bars - Kagi filters out time and tracks direction
1287
+ * flips by reversal threshold. */
1288
+ data?: CandleSeriesInput;
1289
+ /** Price-distance required to reverse direction. `"auto"` =
1290
+ * ATR-derived; or a fixed value. */
1291
+ reversalThreshold?: BoxSizingInput;
1292
+ /** Rule for thick/thin line transitions (yang vs yin). */
1293
+ thicknessRule?: KagiThicknessRule;
1294
+ /** Stroke width for thick (uptrend) lines. */
1295
+ thickLineWidth?: number;
1296
+ /** Stroke width for thin (downtrend) lines. */
1297
+ thinLineWidth?: number;
1298
+ /** Source field for price comparisons. */
1299
+ source?: TimeOffSource;
1300
+ /** Toggle crosshair on hover. */
1301
+ crosshairVisible?: boolean;
1302
+ /** Crosshair line style. */
1303
+ crosshairLineStyle?: GridStyle;
1304
+ /** Snap-marker shape. */
1305
+ crosshairMarker?: CrosshairMarker;
1306
+ width?: number;
1307
+ height?: number;
1308
+ theme?: ThemeInput;
1309
+ palette?: string;
1310
+ visualStyle?: "Fill" | "Outline";
1311
+ outlineFillColor?: "auto" | string;
1312
+ outlineFillOpacity?: number;
1313
+ pixelDensityCap?: number;
1314
+ fastMode?: boolean;
1315
+ /** Glow + glow-color axes. */
1316
+ glow?: GlowInput;
1317
+ glowColor?: GlowColorInput;
1318
+ /** Pattern fills. */
1319
+ pattern?: PatternInput;
1320
+ patternScale?: number;
1321
+ patternColor?: PatternColorInput;
1322
+ ariaLabel?: string;
1323
+ axisVisible?: boolean;
1324
+ yAxisPosition?: YAxisPosition;
1325
+ xAxisPosition?: XAxisPosition;
1326
+ yAxisPadding?: number;
1327
+ gridVisible?: boolean;
1328
+ gridStyle?: GridStyle;
1329
+ gridDensity?: "sparse" | "normal" | "dense";
1330
+ accents?: boolean;
1331
+ locale?: string;
1332
+ timeZone?: string;
1333
+ digitGrouping?: DigitGrouping;
1334
+ numberAbbreviation?: NumberAbbreviation;
1335
+ decimalPlaces?: DecimalPlaces;
1336
+ currency?: string;
1337
+ currencyDisplay?: CurrencyDisplay;
1338
+ percentPrecision?: PercentPrecision;
1339
+ dateFormat?: DateFormat;
1340
+ timeFormat?: TimeFormat;
1341
+ }
1342
+
1343
+ export declare interface KagiChartProps extends KagiChartBaseProps {
1344
+ tooltip?: KagiChartTooltipProp;
1345
+ }
1346
+
1347
+ export declare type KagiChartTooltipProp = undefined | false | ((props: KagiChartTooltipProps) => JSX.Element);
1348
+
1349
+ export declare interface KagiChartTooltipProps {
1350
+ readonly idx: number;
1351
+ readonly direction: 1 | -1;
1352
+ readonly thick: boolean;
1353
+ readonly startPrice: number;
1354
+ readonly endPrice: number;
1355
+ readonly pointerX: number;
1356
+ readonly pointerY: number;
1357
+ readonly containerWidth: number;
1358
+ readonly containerHeight: number;
1359
+ readonly theme: Theme;
1360
+ readonly palette: Palette;
1361
+ readonly locale: string;
1362
+ readonly timeZone: string | undefined;
1363
+ readonly formatter: ChartFormatter;
1364
+ }
1365
+
1366
+ export declare type KagiThicknessRule = "shoulder-waist" | "previous-high-low";
1367
+
1368
+ export declare interface KeyboardHandlerOptions {
1369
+ /** Called with the resolved intent. Caller decides which intents to
1370
+ * honor (e.g. ScatterChart ignores `go-end` since it has no time axis). */
1371
+ readonly onIntent: (intent: KeyboardIntent, ev: KeyboardEvent) => void;
1372
+ /** When `true` (default), the handler calls `preventDefault()` on the
1373
+ * bound keys so the browser doesn't scroll. */
1374
+ readonly preventDefault?: boolean;
1375
+ }
1376
+
1377
+ export declare type KeyboardIntent = "pan-left" | "pan-right" | "pan-up" | "pan-down" | "zoom-in" | "zoom-out" | "reset-zoom" | "reset-domain" | "go-end" | "escape";
1378
+
1379
+ export declare type LabelBehavior = "show-all" | "truncate" | "wrap" | "hide-on-overflow" | "auto";
1380
+
1381
+ export declare interface LabelConfig {
1382
+ position?: ValueLabelPosition;
1383
+ format?: "auto" | ((value: number) => string);
1384
+ /** `'auto'` picks high-contrast based on fill (white on Fill mode,
1385
+ * theme primary text on Outline mode). Hex / rgba string overrides. */
1386
+ color?: "auto" | string;
1387
+ fontSize?: number;
1388
+ fontWeight?: number | "normal" | "bold";
1389
+ }
1390
+
1391
+ export declare type LabelContentInput = LabelContentPreset | ((slice: SliceLabelData) => string);
1392
+
1393
+ export declare type LabelContentPreset = "name" | "value" | "percent" | "name + value" | "name + percent" | "all";
1394
+
1395
+ export declare type LabelPlacement = "inside" | "outside" | "leader-line" | "auto" | "off";
1396
+
1397
+ export declare type LabelRotation = "horizontal" | "radial" | "tangent" | "auto";
1398
+
1399
+ export declare type LastPriceLineStyle = "off" | "solid" | "dashed" | "dotted";
1400
+
1401
+ export declare interface LayerSplitOptions {
1402
+ readonly cssWidth: number;
1403
+ readonly cssHeight: number;
1404
+ /** When `true`, the chart is in sparkline mode; sparklines never use
1405
+ * the dynamic layer (no hover affordances). */
1406
+ readonly sparkline?: boolean;
1407
+ }
1408
+
1409
+ /** Corner anchor for the legend. */
1410
+ declare type LegendPosition = "top-left" | "top-right" | "bottom-left" | "bottom-right";
1411
+
1412
+ /** Legend visibility. */
1413
+ declare type LegendVisibility = "always" | "on-hover" | "off";
1414
+
1415
+ declare interface LevelHighlightConfig {
1416
+ /** `'auto'` resolves to `palette.warn` at draw time (visual urgency). */
1417
+ readonly color?: "auto" | string;
1418
+ readonly lineWidth?: number;
1419
+ readonly lineDash?: readonly number[];
1420
+ }
1421
+
1422
+ export declare type LevelHighlightInput = false | true | LevelHighlightConfig;
1423
+
1424
+ export declare function LineChart(props: LineChartProps): JSX.Element;
1425
+
1426
+ /** Imperative handle exposed via `ref` on `<LineChart>`. Lets the host
1427
+ * push live-tick updates without re-rendering the Solid component.
1428
+ * Binary data ingestion: primitive args. */
1429
+ declare interface LineChartHandle {
1430
+ /** Append a live tick (time ms, price). `size` is accepted for API
1431
+ * parity with CandleChart but is unused for line charts. */
1432
+ onTick(time: number, price: number, size?: number): void;
1433
+ }
1434
+
1435
+ /** Indicator overlays that LineChart can render on the price pane. VWAP
1436
+ * needs OHLC + volume + session_starts and is only available on
1437
+ * CandleChart. */
1438
+ export declare type LineChartIndicatorSpec = {
1439
+ type: "sma";
1440
+ period: number;
1441
+ color?: string;
1442
+ } | {
1443
+ type: "ema";
1444
+ period: number;
1445
+ color?: string;
1446
+ } | {
1447
+ type: "wma";
1448
+ period: number;
1449
+ color?: string;
1450
+ } | {
1451
+ type: "bollinger";
1452
+ period: number;
1453
+ multiplier: number;
1454
+ color?: string;
1455
+ };
1456
+
1457
+ export declare interface LineChartProps {
1458
+ /** Solid ref callback - receives the imperative handle after mount. */
1459
+ ref?: (handle: LineChartHandle) => void;
1460
+ data?: LineSeriesInput;
1461
+ historyData?: LineSeriesInput;
1462
+ series?: readonly SeriesConfig[];
1463
+ width?: number;
1464
+ height?: number;
1465
+ theme?: ThemeInput;
1466
+ palette?: string;
1467
+ visualStyle?: "Fill" | "Outline";
1468
+ outlineFillColor?: "auto" | string;
1469
+ outlineFillOpacity?: number;
1470
+ pixelDensityCap?: number;
1471
+ fastMode?: boolean;
1472
+ sparkline?: boolean;
1473
+ ariaLabel?: string;
1474
+ axisVisible?: boolean;
1475
+ yAxisPosition?: YAxisPosition;
1476
+ xAxisPosition?: XAxisPosition;
1477
+ yAxisPadding?: number;
1478
+ gridVisible?: boolean;
1479
+ gridStyle?: GridStyle;
1480
+ gridDensity?: "sparse" | "normal" | "dense";
1481
+ accents?: boolean;
1482
+ locale?: string;
1483
+ timeZone?: string;
1484
+ crosshairVisible?: boolean;
1485
+ crosshairSnap?: CrosshairSnap;
1486
+ crosshairMode?: CrosshairMode;
1487
+ crosshairLineStyle?: GridStyle;
1488
+ crosshairMarker?: CrosshairMarker;
1489
+ tooltip?: LineChartTooltipProp;
1490
+ indicators?: readonly LineChartIndicatorSpec[];
1491
+ digitGrouping?: DigitGrouping;
1492
+ numberAbbreviation?: NumberAbbreviation;
1493
+ decimalPlaces?: DecimalPlaces;
1494
+ currency?: string;
1495
+ currencyDisplay?: CurrencyDisplay;
1496
+ percentPrecision?: PercentPrecision;
1497
+ dateFormat?: DateFormat;
1498
+ timeFormat?: TimeFormat;
1499
+ lastPriceLine?: LastPriceLineStyle;
1500
+ lastPriceLabel?: boolean;
1501
+ chartBgColor?: string;
1502
+ highLowMarkers?: HighLowMarkers;
1503
+ extremeTooltip?: ExtremeTooltipProp;
1504
+ liveBarIndicator?: LiveBarIndicator;
1505
+ connectionIndicator?: ConnectionIndicatorProp;
1506
+ legendPosition?: LegendPosition;
1507
+ legend?: LegendVisibility;
1508
+ staleVisualization?: StaleVisualization;
1509
+ staleBanner?: StaleBannerProp;
1510
+ liveSince?: number;
1511
+ connectionState?: LiveState;
1512
+ staleThreshold?: number;
1513
+ reducedMotion?: boolean;
1514
+ curveType?: CurveType;
1515
+ stepEdgeRadius?: number;
1516
+ lineWidth?: number;
1517
+ lineDash?: LineDash;
1518
+ lineDashSpacing?: number;
1519
+ pointMarkers?: PointMarkers;
1520
+ areaFill?: AreaFillConfig;
1521
+ glow?: GlowInput;
1522
+ glowColor?: GlowColorInput;
1523
+ }
1524
+
1525
+ export declare type LineChartTooltipProp = boolean | ((props: LineChartTooltipProps) => JSX.Element);
1526
+
1527
+ /** Props passed to a custom LineChart tooltip render function (and to the
1528
+ * built-in `DefaultTooltip` in both React and Solid). Framework-agnostic
1529
+ * data shape. */
1530
+ export declare interface LineChartTooltipProps {
1531
+ /** Time at the active hover position (unix-ms). */
1532
+ t: number;
1533
+ /** Value at the active hover position (primary series only). */
1534
+ value: number;
1535
+ /** Bar index in the source series; -1 when free-snap. */
1536
+ idx: number;
1537
+ /** Per-series values at hover.t - primary first, then secondaries. */
1538
+ seriesValues: readonly TooltipSeriesValue[];
1539
+ /** Pointer position in CSS pixels relative to the chart container. */
1540
+ pointerX: number;
1541
+ pointerY: number;
1542
+ /** Container dimensions for placement decisions. */
1543
+ containerWidth: number;
1544
+ containerHeight: number;
1545
+ /** Resolved theme + palette for color matching. */
1546
+ theme: Theme;
1547
+ palette: Palette;
1548
+ /** Resolved platform locale (e.g. "en-US"). */
1549
+ locale: string;
1550
+ timeZone: string | undefined;
1551
+ /** Per-chart formatter - preferred over `locale` for new tooltip code. */
1552
+ formatter: ChartFormatter;
1553
+ }
1554
+
1555
+ export declare type LineDash = "solid" | "dashed" | "dotted" | readonly number[];
1556
+
1557
+ declare interface LinePoint {
1558
+ t: number;
1559
+ value: number;
1560
+ }
1561
+
1562
+ declare type LineSeriesInput = {
1563
+ points: readonly LinePoint[];
1564
+ } | {
1565
+ times: Float64Array;
1566
+ values: Float64Array;
1567
+ };
1568
+
1569
+ /** Live-bar indicator modes. */
1570
+ declare type LiveBarIndicator = "none" | "dot" | "badge" | "glow" | "outline" | "pulse-bar";
1571
+
1572
+ declare type LiveState = "live" | "stale" | "disconnected";
1573
+
1574
+ export declare type LongPressBehavior = "crosshair" | "context-menu" | "none";
1575
+
1576
+ declare interface MacdSpecInput extends IndicatorPaneCommon {
1577
+ type: "macd";
1578
+ fastPeriod?: number;
1579
+ slowPeriod?: number;
1580
+ signalPeriod?: number;
1581
+ histogramVisible?: boolean;
1582
+ }
1583
+
1584
+ /** Build a keyboard listener that funnels mapped keys into `onIntent`.
1585
+ * Unmapped keys pass through (no preventDefault). Returns a function
1586
+ * the caller can `removeEventListener` to dispose. */
1587
+ export declare function makeKeyboardHandler(opts: KeyboardHandlerOptions): (ev: KeyboardEvent) => void;
1588
+
1589
+ /** Build a pinch handler. Tracks active pointers and emits scale deltas
1590
+ * on every pointermove during a two-finger gesture. */
1591
+ export declare function makePinchHandler(opts: PinchHandlerOptions): PinchHandler;
1592
+
1593
+ export declare interface MarkerConfig {
1594
+ style?: MarkerStyle;
1595
+ /** Diameter / longest side, in CSS px. Floored to `MIN_MARKER_SIZE` (1.5)
1596
+ * internally so markers don't disappear at extreme zoom-out. Default 5. */
1597
+ size?: number;
1598
+ /** Fill color. `'auto'` = the line's resolved color. `'none'` = no fill. */
1599
+ fill?: "auto" | "none" | string;
1600
+ /** Stroke color. `'auto'` matches `fill`. `'none'` = no stroke. */
1601
+ stroke?: "auto" | "none" | string;
1602
+ /** Stroke width in CSS px. `0` (default) = no border. */
1603
+ strokeWidth?: number;
1604
+ /** Up-arrow color when `style: 'direction'`. `'auto'` = `palette.up`. */
1605
+ upColor?: "auto" | string;
1606
+ /** Down-arrow color when `style: 'direction'`. `'auto'` = `palette.down`. */
1607
+ downColor?: "auto" | string;
1608
+ /** Custom up/down icons for `style: 'direction'`. Defaults to the built-in
1609
+ * chevron when `undefined`. */
1610
+ upIcon?: MarkerIcon;
1611
+ downIcon?: MarkerIcon;
1612
+ /** Required when `style: 'custom'`. Used for every data point. */
1613
+ icon?: MarkerIcon;
1614
+ }
1615
+
1616
+ /** Custom-icon shapes accepted by `MarkerConfig.icon` / `upIcon` / `downIcon`.
1617
+ * Evaluated synchronously per draw - no async resolution, no React-component
1618
+ * offscreen rendering (that's a future sweep when we add
1619
+ * bitmap-cache infra). */
1620
+ export declare type MarkerIcon =
1621
+ /** SVG path-data string (e.g. `"M-1,-1 L1,1 ..."`). Parsed to a cached
1622
+ * `Path2D` once per unique string at first use. */
1623
+ string
1624
+ /** Pre-built `Path2D` - used directly. */
1625
+ | Path2D
1626
+ /** Direct-draw function - called per point with translated origin.
1627
+ * Receives a context whose origin is at (x, y) and scaled to half-size,
1628
+ * so the function should draw the shape in [-1, 1] coordinates. */
1629
+ | ((ctx: CanvasRenderingContext2D) => void);
1630
+
1631
+ export declare type MarkerStyle = "circle" | "square" | "diamond" | "triangle" | "triangle-down" | "cross" | "plus" | "star" | "direction" | "custom";
1632
+
1633
+ declare type MarketKind = "equity" | "dst-equity" | "crypto-24-7";
1634
+
1635
+ declare interface MidLineConfig {
1636
+ readonly style?: MidLineStyle;
1637
+ readonly color?: "auto" | string;
1638
+ readonly lineWidth?: number;
1639
+ }
1640
+
1641
+ export declare type MidLineInput = false | true | "dashed" | MidLineConfig;
1642
+
1643
+ export declare type MidLineStyle = "solid" | "dashed";
1644
+
1645
+ export declare const MULTI_CHART_THRESHOLD = 4;
1646
+
1647
+ export declare type NullBehavior = "empty" | "cross-hatch" | "background";
1648
+
1649
+ declare type NumberAbbreviation = "off" | "compact" | "lakh-crore" | "auto";
1650
+
1651
+ /** Allow a user-supplied function to bypass all built-in behavior. */
1652
+ export declare type NumberFormatInput = NumberFormatPreset | ((n: number) => string);
1653
+
1654
+ export declare type NumberFormatPreset = "standard" | "compact" | "pk-grouping" | "pk-compact" | "percent" | "currency";
1655
+
1656
+ export declare interface OffscreenContext {
1657
+ /** Total bars in the dataset. */
1658
+ readonly bulkBarCount?: number;
1659
+ /** Charts mounted on the same page sharing the engine. */
1660
+ readonly mountedChartCount?: number;
1661
+ /** Currently-visible marks (after downsampling). */
1662
+ readonly visibleMarkCount?: number;
1663
+ /** Honor host opt-outs (e.g. SSR snapshot mode). */
1664
+ readonly disabled?: boolean;
1665
+ }
1666
+
1667
+ declare interface Oklch {
1668
+ L: number;
1669
+ C: number;
1670
+ h: number;
1671
+ }
1672
+
1673
+ declare interface OrderMarker {
1674
+ /** Bar t the order lives at (typically the most-recent bar). */
1675
+ t: number;
1676
+ side: OrderSide;
1677
+ entryPrice: number;
1678
+ stopLossPrice?: number;
1679
+ takeProfitPrice?: number;
1680
+ meta?: Record<string, unknown>;
1681
+ }
1682
+
1683
+ declare type OrderSide = "buy" | "sell";
1684
+
1685
+ declare interface OrderTooltipProps {
1686
+ marker: OrderMarker;
1687
+ pointerX: number;
1688
+ pointerY: number;
1689
+ formatter: ChartFormatter;
1690
+ }
1691
+
1692
+ declare type Orientation = "vertical" | "horizontal";
1693
+
1694
+ declare interface OverlayStyle {
1695
+ /** `'auto'` resolves to `palette.neutral` at draw time. */
1696
+ readonly color?: "auto" | string;
1697
+ readonly lineWidth?: number;
1698
+ readonly lineDash?: readonly number[];
1699
+ }
1700
+
1701
+ declare interface Palette {
1702
+ name: string;
1703
+ light: PaletteVariant;
1704
+ dark: PaletteVariant;
1705
+ tonalSymmetrySide: TonalSymmetrySide;
1706
+ tonalSymmetryFlipInDarkMode: boolean;
1707
+ }
1708
+
1709
+ export declare class PaletteValidationError extends Error {
1710
+ readonly paletteName: string;
1711
+ readonly missingSlot: string;
1712
+ readonly name = "PaletteValidationError";
1713
+ constructor(paletteName: string, missingSlot: string);
1714
+ }
1715
+
1716
+ declare interface PaletteVariant {
1717
+ up: Oklch;
1718
+ down: Oklch;
1719
+ doji: Oklch;
1720
+ neutral: Oklch;
1721
+ /** Caution / amber - used for stale state (connection indicator + stale
1722
+ * banner). Must read as "warning" without competing with `up`/`down`. */
1723
+ warn: Oklch;
1724
+ accentTint: Oklch;
1725
+ categorical: readonly Oklch[];
1726
+ indicators: {
1727
+ sma: Oklch;
1728
+ ema: Oklch;
1729
+ wma: Oklch;
1730
+ bb: Oklch;
1731
+ fib: Oklch;
1732
+ rsi: Oklch;
1733
+ macd: Oklch;
1734
+ stochastic: Oklch;
1735
+ atr: Oklch;
1736
+ vwap: Oklch;
1737
+ };
1738
+ drawings: {
1739
+ stroke: Oklch;
1740
+ fill: Oklch;
1741
+ handle: Oklch;
1742
+ label: Oklch;
1743
+ };
1744
+ /** Optional event-kind colors. When absent,
1745
+ * the chart falls back to a built-in default for each kind. */
1746
+ events?: {
1747
+ earnings?: Oklch;
1748
+ dividend?: Oklch;
1749
+ split?: Oklch;
1750
+ news?: Oklch;
1751
+ };
1752
+ }
1753
+
1754
+ export declare type PanAxis = "x" | "y" | "both";
1755
+
1756
+ export declare type PanEdgeBehavior =
1757
+ /** Hard stop at the data extents. */
1758
+ "stop"
1759
+ /** Allow over-pan with a small empty band. */
1760
+ | "overshoot"
1761
+ /** Wrap around (rarely useful for finance - left for completeness). */
1762
+ | "wrap";
1763
+
1764
+ export declare interface PanZoomOptions {
1765
+ readonly panEnabled: boolean;
1766
+ readonly zoomEnabled: boolean;
1767
+ readonly zoomAnchor: ZoomAnchor;
1768
+ readonly panEdgeBehavior: PanEdgeBehavior;
1769
+ readonly panInertia: boolean;
1770
+ readonly wheelBehavior: WheelBehavior;
1771
+ readonly panAxis: PanAxis;
1772
+ readonly doubleClickReset: boolean;
1773
+ readonly yAxisManualRescale: boolean;
1774
+ }
1775
+
1776
+ export declare type PanZoomOptionsInput = {
1777
+ readonly [K in keyof PanZoomOptions]?: PanZoomOptions[K] | undefined;
1778
+ };
1779
+
1780
+ export declare type PatternColorInput = "auto" | string;
1781
+
1782
+ /** Host-supplied input - string preset, config form, or a literal
1783
+ * `CanvasPattern` (full dev control). */
1784
+ export declare type PatternInput = PatternPreset | {
1785
+ readonly type: PatternPreset;
1786
+ readonly scale?: number;
1787
+ readonly lineWidth?: number;
1788
+ readonly color?: string;
1789
+ } | CanvasPattern;
1790
+
1791
+ export declare type PatternPreset = "solid" | "diagonal-lines" | "diagonal-lines-reverse" | "cross-hatch" | "dots" | "circles" | "grid" | "horizontal-lines" | "vertical-lines" | "plus" | "chevron" | "zigzag" | "waves" | "checkerboard" | "hexagons" | "bricks";
1792
+
1793
+ declare type PercentPrecision = "auto" | number;
1794
+
1795
+ export declare function PieChart(props: PieChartProps): JSX.Element;
1796
+
1797
+ declare interface PieChartBaseProps {
1798
+ /** Slice data - array of `{ name, value, color? }`. Each value
1799
+ * becomes a slice proportional to its share of the total. */
1800
+ data?: PieSeriesInput;
1801
+ /** Default -90° (12 o'clock). Degrees. */
1802
+ startAngle?: number;
1803
+ /** Default 270° (full circle). Degrees. */
1804
+ endAngle?: number;
1805
+ /** Default 3°. Gap between slices, in degrees. */
1806
+ padAngle?: number;
1807
+ /** Default 0 (Pie) / 0.5 (Donut). */
1808
+ innerRadius?: number;
1809
+ /** Default 'auto'. */
1810
+ labelPlacement?: LabelPlacement;
1811
+ /** Default 'name + percent'. */
1812
+ labelContent?: LabelContentInput;
1813
+ /** Default 'value-desc'. */
1814
+ sortOrder?: SortOrder;
1815
+ /** Default false. */
1816
+ smallSliceThreshold?: SmallSliceThresholdInput;
1817
+ legend?: LegendVisibility;
1818
+ legendPosition?: LegendPosition;
1819
+ crosshairVisible?: boolean;
1820
+ crosshairLineStyle?: GridStyle;
1821
+ crosshairMarker?: CrosshairMarker;
1822
+ width?: number;
1823
+ height?: number;
1824
+ theme?: ThemeInput;
1825
+ palette?: string;
1826
+ visualStyle?: "Fill" | "Outline";
1827
+ outlineFillColor?: "auto" | string;
1828
+ outlineFillOpacity?: number;
1829
+ pixelDensityCap?: number;
1830
+ fastMode?: boolean;
1831
+ /** Glow + glow-color axes. */
1832
+ glow?: GlowInput;
1833
+ glowColor?: GlowColorInput;
1834
+ /** Pattern fills. */
1835
+ pattern?: PatternInput;
1836
+ patternScale?: number;
1837
+ patternColor?: PatternColorInput;
1838
+ ariaLabel?: string;
1839
+ accents?: boolean;
1840
+ locale?: string;
1841
+ timeZone?: string;
1842
+ cornerRadius?: number;
1843
+ borderWidth?: number;
1844
+ digitGrouping?: DigitGrouping;
1845
+ numberAbbreviation?: NumberAbbreviation;
1846
+ decimalPlaces?: DecimalPlaces;
1847
+ currency?: string;
1848
+ currencyDisplay?: CurrencyDisplay;
1849
+ percentPrecision?: PercentPrecision;
1850
+ dateFormat?: DateFormat;
1851
+ timeFormat?: TimeFormat;
1852
+ }
1853
+
1854
+ export declare interface PieChartProps extends PieChartBaseProps {
1855
+ tooltip?: PieChartTooltipProp;
1856
+ }
1857
+
1858
+ export declare type PieChartTooltipProp = undefined | false | ((props: PieChartTooltipProps) => JSX.Element);
1859
+
1860
+ export declare interface PieChartTooltipProps {
1861
+ /** Slice index in the post-sort/combine order. */
1862
+ readonly idx: number;
1863
+ readonly name: string;
1864
+ readonly value: number;
1865
+ /** 0–1 fraction of the total. */
1866
+ readonly percent: number;
1867
+ readonly color: string;
1868
+ readonly pointerX: number;
1869
+ readonly pointerY: number;
1870
+ readonly containerWidth: number;
1871
+ readonly containerHeight: number;
1872
+ readonly theme: Theme;
1873
+ readonly palette: Palette;
1874
+ readonly locale: string;
1875
+ readonly timeZone: string | undefined;
1876
+ readonly formatter: ChartFormatter;
1877
+ }
1878
+
1879
+ export declare type PieSeriesInput = {
1880
+ readonly slices: readonly PieSlice[];
1881
+ } | {
1882
+ readonly values: Float64Array | readonly number[];
1883
+ readonly names: readonly string[];
1884
+ readonly colors?: ReadonlyArray<string | undefined>;
1885
+ };
1886
+
1887
+ export declare interface PieSlice {
1888
+ readonly name: string;
1889
+ readonly value: number;
1890
+ /** Optional CSS color override. When omitted, palette.categorical[i] cycles. */
1891
+ readonly color?: string;
1892
+ }
1893
+
1894
+ export declare interface PinchEvent {
1895
+ /** Scale ratio relative to the gesture start (`1 = no change`,
1896
+ * `>1 = zoom in`, `<1 = zoom out`). */
1897
+ readonly scale: number;
1898
+ /** Midpoint of the two pointers, in CSS px on the host element. */
1899
+ readonly centerX: number;
1900
+ readonly centerY: number;
1901
+ }
1902
+
1903
+ export declare interface PinchHandler {
1904
+ onPointerDown(ev: PointerEvent): void;
1905
+ onPointerMove(ev: PointerEvent): void;
1906
+ onPointerUp(ev: PointerEvent): void;
1907
+ /** Force-clear the active gesture (e.g. on unmount). */
1908
+ dispose(): void;
1909
+ }
1910
+
1911
+ export declare interface PinchHandlerOptions {
1912
+ readonly onPinch: (ev: PinchEvent) => void;
1913
+ readonly onPinchEnd?: () => void;
1914
+ }
1915
+
1916
+ declare interface PnFChartBaseProps {
1917
+ /** Required OHLC bars - the chart filters out time and renders X / O
1918
+ * symbols based on price-reversal logic. */
1919
+ data?: CandleSeriesInput;
1920
+ /** Box-size strategy - `"auto"` (ATR-derived) or explicit value. */
1921
+ boxSize?: BoxSizingInput;
1922
+ /** Number of boxes against the trend required to flip direction.
1923
+ * Standard is 3. */
1924
+ reversalCount?: number;
1925
+ /** Source field for price: `"close"` (default) or `"high-low"`. */
1926
+ source?: TimeOffSource;
1927
+ /** Symbol style for X / O columns. */
1928
+ symbolStyle?: PnFSymbolStyle;
1929
+ /** Padding between symbols within a column. */
1930
+ symbolPadding?: number;
1931
+ /** Toggle crosshair on hover. */
1932
+ crosshairVisible?: boolean;
1933
+ /** Crosshair line style. */
1934
+ crosshairLineStyle?: GridStyle;
1935
+ /** Snap-marker shape. */
1936
+ crosshairMarker?: CrosshairMarker;
1937
+ width?: number;
1938
+ height?: number;
1939
+ theme?: ThemeInput;
1940
+ palette?: string;
1941
+ visualStyle?: "Fill" | "Outline";
1942
+ outlineFillColor?: "auto" | string;
1943
+ outlineFillOpacity?: number;
1944
+ pixelDensityCap?: number;
1945
+ fastMode?: boolean;
1946
+ /** Glow + glow-color axes. */
1947
+ glow?: GlowInput;
1948
+ glowColor?: GlowColorInput;
1949
+ /** Pattern fills. */
1950
+ pattern?: PatternInput;
1951
+ patternScale?: number;
1952
+ patternColor?: PatternColorInput;
1953
+ ariaLabel?: string;
1954
+ axisVisible?: boolean;
1955
+ yAxisPosition?: YAxisPosition;
1956
+ xAxisPosition?: XAxisPosition;
1957
+ yAxisPadding?: number;
1958
+ gridVisible?: boolean;
1959
+ gridStyle?: GridStyle;
1960
+ gridDensity?: "sparse" | "normal" | "dense";
1961
+ accents?: boolean;
1962
+ locale?: string;
1963
+ timeZone?: string;
1964
+ cornerRadius?: number;
1965
+ borderWidth?: number;
1966
+ digitGrouping?: DigitGrouping;
1967
+ numberAbbreviation?: NumberAbbreviation;
1968
+ decimalPlaces?: DecimalPlaces;
1969
+ currency?: string;
1970
+ currencyDisplay?: CurrencyDisplay;
1971
+ percentPrecision?: PercentPrecision;
1972
+ dateFormat?: DateFormat;
1973
+ timeFormat?: TimeFormat;
1974
+ }
1975
+
1976
+ export declare interface PnFChartTooltipProps {
1977
+ readonly idx: number;
1978
+ readonly direction: 1 | -1;
1979
+ readonly bottomBox: number;
1980
+ readonly topBox: number;
1981
+ readonly pointerX: number;
1982
+ readonly pointerY: number;
1983
+ readonly containerWidth: number;
1984
+ readonly containerHeight: number;
1985
+ readonly theme: Theme;
1986
+ readonly palette: Palette;
1987
+ readonly locale: string;
1988
+ readonly timeZone: string | undefined;
1989
+ readonly formatter: ChartFormatter;
1990
+ }
1991
+
1992
+ export declare type PnFSymbolStyle = "classic" | "filled";
1993
+
1994
+ export declare function PointFigureChart(props: PointFigureChartProps): JSX.Element;
1995
+
1996
+ export declare interface PointFigureChartProps extends PnFChartBaseProps {
1997
+ tooltip?: PointFigureChartTooltipProp;
1998
+ }
1999
+
2000
+ export declare type PointFigureChartTooltipProp = undefined | false | ((props: PnFChartTooltipProps) => JSX.Element);
2001
+
2002
+ export declare type PointMarkers = boolean | MarkerConfig;
2003
+
2004
+ export declare type PointOpacityInput = number | "auto";
2005
+
2006
+ declare interface PointSizeConfig {
2007
+ /** `'linear'` (radius linear in value) or `'sqrt'` (area linear in value).
2008
+ * Default `'sqrt'` - perceptually correct for area-encoded bubbles. */
2009
+ readonly scale?: BubbleScale;
2010
+ /** `[minPx, maxPx]` - the rendered diameter range. Default [4, 32]. */
2011
+ readonly range?: readonly [number, number];
2012
+ }
2013
+
2014
+ export declare type PointSizeInput = number | "data-driven" | PointSizeConfig;
2015
+
2016
+ declare interface PositionMarker {
2017
+ t: number;
2018
+ side: "long" | "short";
2019
+ entryPrice: number;
2020
+ /** Quantity in shares / lots - used by P&L pill calculations. */
2021
+ qty: number;
2022
+ meta?: Record<string, unknown>;
2023
+ }
2024
+
2025
+ declare interface PositionTooltipProps {
2026
+ marker: PositionMarker;
2027
+ lastClose: number;
2028
+ pointerX: number;
2029
+ pointerY: number;
2030
+ formatter: ChartFormatter;
2031
+ }
2032
+
2033
+ export declare type PriceRangeInput = "auto" | number | PriceRangeWindow;
2034
+
2035
+ export declare interface PriceRangeWindow {
2036
+ /** Lower bound as fraction off mid (typically negative). */
2037
+ readonly minPct: number;
2038
+ /** Upper bound as fraction off mid (typically positive). */
2039
+ readonly maxPct: number;
2040
+ }
2041
+
2042
+ declare interface QualitativeConfig {
2043
+ readonly type: "qualitative";
2044
+ }
2045
+
2046
+ export declare type RadiusProportion = "uniform" | "value-weighted" | "sqrt-weighted";
2047
+
2048
+ export declare interface Rect {
2049
+ readonly x: number;
2050
+ readonly y: number;
2051
+ readonly w: number;
2052
+ readonly h: number;
2053
+ }
2054
+
2055
+ export declare type ReferencePoint = "first-visible" | "last-bar" | number;
2056
+
2057
+ export declare function registerPalette(palette: Palette): void;
2058
+
2059
+ export declare type RegressionLineInput = false | true | (RegressionStyle & {
2060
+ readonly type: "linear";
2061
+ }) | (RegressionStyle & {
2062
+ readonly type: "polynomial";
2063
+ readonly degree?: number;
2064
+ }) | (RegressionStyle & {
2065
+ readonly type: "exponential";
2066
+ }) | (RegressionStyle & {
2067
+ readonly type: "lowess";
2068
+ readonly bandwidth?: number;
2069
+ });
2070
+
2071
+ declare interface RegressionStyle {
2072
+ /** `'auto'` resolves to `palette.neutral` at draw time. */
2073
+ readonly color?: "auto" | string;
2074
+ readonly lineWidth?: number;
2075
+ readonly lineDash?: readonly number[];
2076
+ }
2077
+
2078
+ export declare type RegressionType = "linear" | "polynomial" | "exponential" | "lowess";
2079
+
2080
+ /** Map a downgrade level to the render config the chart should apply. */
2081
+ export declare interface RenderConfigOverrides {
2082
+ readonly disableGlow: boolean;
2083
+ readonly disableAnimations: boolean;
2084
+ readonly capDpr: boolean;
2085
+ }
2086
+
2087
+ export declare function renderExtremeTooltip(prop: ExtremeTooltipProp | undefined, tooltipProps: ExtremeTooltipProps): JSX.Element;
2088
+
2089
+ export declare function RenkoChart(props: RenkoChartProps): JSX.Element;
2090
+
2091
+ declare interface RenkoChartBaseProps {
2092
+ /** Required OHLC bars - Renko filters out time and renders fixed-
2093
+ * size price-movement bricks. */
2094
+ data?: CandleSeriesInput;
2095
+ /** Default 'atr-14'. */
2096
+ brickSize?: BoxSizingInput;
2097
+ /** Default 2. */
2098
+ reversalThreshold?: number;
2099
+ /** Default 'close'. */
2100
+ source?: TimeOffSource;
2101
+ /** Default 0 (touching bricks). */
2102
+ brickGap?: number;
2103
+ crosshairVisible?: boolean;
2104
+ crosshairLineStyle?: GridStyle;
2105
+ crosshairMarker?: CrosshairMarker;
2106
+ width?: number;
2107
+ height?: number;
2108
+ theme?: ThemeInput;
2109
+ palette?: string;
2110
+ visualStyle?: "Fill" | "Outline";
2111
+ outlineFillColor?: "auto" | string;
2112
+ outlineFillOpacity?: number;
2113
+ pixelDensityCap?: number;
2114
+ fastMode?: boolean;
2115
+ /** Glow + glow-color axes. */
2116
+ glow?: GlowInput;
2117
+ glowColor?: GlowColorInput;
2118
+ /** Pattern fills. */
2119
+ pattern?: PatternInput;
2120
+ patternScale?: number;
2121
+ patternColor?: PatternColorInput;
2122
+ ariaLabel?: string;
2123
+ axisVisible?: boolean;
2124
+ yAxisPosition?: YAxisPosition;
2125
+ xAxisPosition?: XAxisPosition;
2126
+ yAxisPadding?: number;
2127
+ gridVisible?: boolean;
2128
+ gridStyle?: GridStyle;
2129
+ gridDensity?: "sparse" | "normal" | "dense";
2130
+ accents?: boolean;
2131
+ locale?: string;
2132
+ timeZone?: string;
2133
+ cornerRadius?: number;
2134
+ borderWidth?: number;
2135
+ digitGrouping?: DigitGrouping;
2136
+ numberAbbreviation?: NumberAbbreviation;
2137
+ decimalPlaces?: DecimalPlaces;
2138
+ currency?: string;
2139
+ currencyDisplay?: CurrencyDisplay;
2140
+ percentPrecision?: PercentPrecision;
2141
+ dateFormat?: DateFormat;
2142
+ timeFormat?: TimeFormat;
2143
+ }
2144
+
2145
+ export declare interface RenkoChartProps extends RenkoChartBaseProps {
2146
+ tooltip?: RenkoChartTooltipProp;
2147
+ }
2148
+
2149
+ export declare type RenkoChartTooltipProp = undefined | false | ((props: RenkoChartTooltipProps) => JSX.Element);
2150
+
2151
+ export declare interface RenkoChartTooltipProps {
2152
+ readonly idx: number;
2153
+ readonly direction: 1 | -1;
2154
+ readonly bottomPrice: number;
2155
+ readonly topPrice: number;
2156
+ readonly sourceTime: number;
2157
+ readonly pointerX: number;
2158
+ readonly pointerY: number;
2159
+ readonly containerWidth: number;
2160
+ readonly containerHeight: number;
2161
+ readonly theme: Theme;
2162
+ readonly palette: Palette;
2163
+ readonly locale: string;
2164
+ readonly timeZone: string | undefined;
2165
+ readonly formatter: ChartFormatter;
2166
+ }
2167
+
2168
+ declare interface ResolvedBase {
2169
+ readonly color: "auto" | string;
2170
+ readonly lineWidth: number;
2171
+ readonly lineDash: readonly number[] | null;
2172
+ }
2173
+
2174
+ export declare type ResolvedBoxSizing = {
2175
+ readonly type: "fixed";
2176
+ readonly value: number;
2177
+ } | {
2178
+ readonly type: "atr";
2179
+ readonly period: number;
2180
+ } | {
2181
+ readonly type: "percent";
2182
+ readonly value: number;
2183
+ };
2184
+
2185
+ export declare interface ResolvedGlow {
2186
+ /** Normalized strength 0..1. Zero means glow is off; the rendering
2187
+ * primitive short-circuits and avoids the offscreen pass entirely. */
2188
+ readonly strength: number;
2189
+ /** Direction-aware or literal. `'auto'` triggers direction resolution at
2190
+ * draw time using the chart's palette. */
2191
+ readonly color: "auto" | string;
2192
+ }
2193
+
2194
+ export declare interface ResolvedHistogramOverlay {
2195
+ readonly type: HistogramOverlayType;
2196
+ readonly color: "auto" | string;
2197
+ readonly lineWidth: number;
2198
+ readonly lineDash: readonly number[] | null;
2199
+ }
2200
+
2201
+ export declare interface ResolvedLevelHighlight {
2202
+ readonly color: "auto" | string;
2203
+ readonly lineWidth: number;
2204
+ readonly lineDash: readonly number[] | null;
2205
+ }
2206
+
2207
+ declare interface ResolvedLocale {
2208
+ /** Uppercase ISO 3166-1 alpha-3 code. */
2209
+ readonly country: string;
2210
+ /** Platform-formatter locale for international grouping. */
2211
+ readonly baseLocale: string;
2212
+ /** Locale for lakh-crore (lakh/crore) grouping with Latin digits forced.
2213
+ * When undefined, the country has no native lakh-crore-grouping
2214
+ * locale; ChartFormatter falls back to its custom 5-line formatter
2215
+ * when the host opts into lakh-crore grouping. */
2216
+ readonly lakhCroreLocale: string | undefined;
2217
+ /** ISO 4217 currency code paired with this locale by default. */
2218
+ readonly defaultCurrency: string;
2219
+ }
2220
+
2221
+ export declare interface ResolvedMidLine {
2222
+ readonly style: MidLineStyle;
2223
+ readonly color: "auto" | string;
2224
+ readonly lineWidth: number;
2225
+ }
2226
+
2227
+ export declare interface ResolvedNumberFormat {
2228
+ readonly preset: NumberFormatPreset | null;
2229
+ /** Non-null when the host passed a literal function. */
2230
+ readonly custom: ((n: number) => string) | null;
2231
+ /** Derived `digitGrouping` for the underlying formatter. */
2232
+ readonly digitGrouping: DigitGrouping;
2233
+ /** Derived `numberAbbreviation`. */
2234
+ readonly numberAbbreviation: NumberAbbreviation;
2235
+ /** When the preset is `'percent'` or `'currency'`, the formatter
2236
+ * routes through a percent / currency code path. */
2237
+ readonly mode: "number" | "percent" | "currency";
2238
+ }
2239
+
2240
+ export declare interface ResolvedPattern {
2241
+ readonly type: PatternPreset;
2242
+ readonly scale: number;
2243
+ readonly lineWidth: number;
2244
+ /** `'auto'` triggers per-mark color derivation at draw time (uses the
2245
+ * mark's own fill color with OKLCH L-shift); a literal string forces
2246
+ * uniform pattern color. */
2247
+ readonly color: "auto" | string;
2248
+ /** Literal `CanvasPattern` (custom dev pattern). When non-null, the
2249
+ * rendering primitive uses it directly and ignores `type`. */
2250
+ readonly customPattern: CanvasPattern | null;
2251
+ }
2252
+
2253
+ export declare type ResolvedPointSize = {
2254
+ readonly kind: "fixed";
2255
+ readonly size: number;
2256
+ } | {
2257
+ readonly kind: "data-driven";
2258
+ readonly scale: BubbleScale;
2259
+ readonly range: readonly [number, number];
2260
+ };
2261
+
2262
+ export declare type ResolvedRegressionLine = (ResolvedBase & {
2263
+ readonly type: "linear";
2264
+ }) | (ResolvedBase & {
2265
+ readonly type: "polynomial";
2266
+ readonly degree: number;
2267
+ }) | (ResolvedBase & {
2268
+ readonly type: "exponential";
2269
+ }) | (ResolvedBase & {
2270
+ readonly type: "lowess";
2271
+ readonly bandwidth: number;
2272
+ });
2273
+
2274
+ export declare interface ResolvedSmallSliceThreshold {
2275
+ readonly threshold: number;
2276
+ readonly label: string;
2277
+ readonly color: "auto" | string;
2278
+ }
2279
+
2280
+ /** Resolved + normalized tooltip slot - the chart calls `mode === 'render'`
2281
+ * and invokes `render(props)` to materialise the tooltip, or skips when
2282
+ * `mode === 'off'`. */
2283
+ export declare type ResolvedTooltip<P> = {
2284
+ readonly mode: "off";
2285
+ } | {
2286
+ readonly mode: "default";
2287
+ } | {
2288
+ readonly mode: "render";
2289
+ readonly render: (p: P) => unknown;
2290
+ };
2291
+
2292
+ /** Translate `fastMode: 'auto'` into a concrete boolean using the
2293
+ * context. Three triggers:
2294
+ * - effectiveType is "slow-2g" / "2g"
2295
+ * - deviceMemory ≤ 2 GB
2296
+ * - prefersReducedMotion is set
2297
+ * Any one trigger flips fastMode on. */
2298
+ export declare function resolveFastModeAuto(input: FastModeInput | undefined, ctx: FastModeContext): boolean;
2299
+
2300
+ /** Resolve glow inputs to a normalized form. `fastMode` forces strength
2301
+ * to zero regardless of input. */
2302
+ export declare function resolveGlow(input: GlowInput | undefined, color: GlowColorInput | undefined, fastMode: boolean): ResolvedGlow;
2303
+
2304
+ /** Resolve the halo stroke/fill color used in glow passes for a given
2305
+ * mark direction. Returns a CSS color string ready to assign to
2306
+ * `ctx.strokeStyle` / `ctx.fillStyle`. */
2307
+ export declare function resolveGlowHaloColor(glow: ResolvedGlow, theme: Theme, directionRgba: string): string;
2308
+
2309
+ export declare function resolveGpuRenderer(input: GpuRendererInput | undefined): GpuRendererInput;
2310
+
2311
+ export declare function resolveNumberFormat(input: NumberFormatInput | undefined): ResolvedNumberFormat;
2312
+
2313
+ export declare function resolvePanZoomOptions(input: PanZoomOptionsInput | undefined): PanZoomOptions;
2314
+
2315
+ export declare function resolvePattern(input: PatternInput | undefined, scale: number | undefined, color: PatternColorInput | undefined): ResolvedPattern;
2316
+
2317
+ export declare function resolveTooltip<P>(input: TooltipInput<P> | undefined): ResolvedTooltip<P>;
2318
+
2319
+ declare interface RsiSpecInput extends IndicatorPaneCommon {
2320
+ type: "rsi";
2321
+ period?: number;
2322
+ overbought?: number;
2323
+ oversold?: number;
2324
+ }
2325
+
2326
+ export declare function ScatterChart(props: ScatterChartProps): JSX.Element;
2327
+
2328
+ declare interface ScatterChartBaseProps {
2329
+ /** Single-series point data - `xs` + `ys` + optional `sizes`. */
2330
+ data?: ScatterSeriesInput;
2331
+ /** Multi-series - pass an array of named series. */
2332
+ series?: readonly ScatterSeriesConfig[];
2333
+ /** Default 9 (fixed pixel diameter). */
2334
+ pointSize?: PointSizeInput;
2335
+ /** Default 'auto' - lowers per-point alpha at high counts. */
2336
+ pointOpacity?: PointOpacityInput;
2337
+ /** Default false. */
2338
+ regressionLine?: RegressionLineInput;
2339
+ /** Default 'auto' - switches to heatmap at ≥50k points. */
2340
+ density?: DensityInput;
2341
+ /** Inherits LineChart's MarkerConfig - controls point shape + fill/stroke
2342
+ * treatment. `pointSize` overrides the size field. */
2343
+ pointMarker?: PointMarkers;
2344
+ legend?: LegendVisibility;
2345
+ legendPosition?: LegendPosition;
2346
+ crosshairVisible?: boolean;
2347
+ crosshairLineStyle?: GridStyle;
2348
+ crosshairMarker?: CrosshairMarker;
2349
+ width?: number;
2350
+ height?: number;
2351
+ theme?: ThemeInput;
2352
+ palette?: string;
2353
+ visualStyle?: "Fill" | "Outline";
2354
+ outlineFillColor?: "auto" | string;
2355
+ outlineFillOpacity?: number;
2356
+ pixelDensityCap?: number;
2357
+ fastMode?: boolean;
2358
+ /** Glow + glow-color axes. */
2359
+ glow?: GlowInput;
2360
+ glowColor?: GlowColorInput;
2361
+ /** Pattern fills. */
2362
+ pattern?: PatternInput;
2363
+ patternScale?: number;
2364
+ patternColor?: PatternColorInput;
2365
+ sparkline?: boolean;
2366
+ ariaLabel?: string;
2367
+ axisVisible?: boolean;
2368
+ yAxisPosition?: YAxisPosition;
2369
+ xAxisPosition?: XAxisPosition;
2370
+ yAxisPadding?: number;
2371
+ xAxisPadding?: number;
2372
+ gridVisible?: boolean;
2373
+ gridStyle?: GridStyle;
2374
+ gridDensity?: "sparse" | "normal" | "dense";
2375
+ accents?: boolean;
2376
+ locale?: string;
2377
+ timeZone?: string;
2378
+ digitGrouping?: DigitGrouping;
2379
+ numberAbbreviation?: NumberAbbreviation;
2380
+ decimalPlaces?: DecimalPlaces;
2381
+ currency?: string;
2382
+ currencyDisplay?: CurrencyDisplay;
2383
+ percentPrecision?: PercentPrecision;
2384
+ dateFormat?: DateFormat;
2385
+ timeFormat?: TimeFormat;
2386
+ }
2387
+
2388
+ export declare interface ScatterChartProps extends ScatterChartBaseProps {
2389
+ tooltip?: ScatterChartTooltipProp;
2390
+ }
2391
+
2392
+ export declare type ScatterChartTooltipProp = undefined | false | ((props: ScatterChartTooltipProps) => JSX.Element);
2393
+
2394
+ export declare interface ScatterChartTooltipProps {
2395
+ /** X-coordinate of the hovered point. */
2396
+ readonly x: number;
2397
+ /** Y-coordinate of the hovered point. */
2398
+ readonly y: number;
2399
+ /** Optional size value (when `pointSize` is data-driven). */
2400
+ readonly size: number | null;
2401
+ /** Index into the hovered series. */
2402
+ readonly idx: number;
2403
+ /** Index into the chart's series list (0 = primary, ≥1 = secondaries). */
2404
+ readonly seriesIdx: number;
2405
+ /** Series id (from `series[i].id`, or `'primary'` when only `data` was passed). */
2406
+ readonly seriesId: string;
2407
+ /** Series display label (`series[i].label ?? id`, or `'Value'` for primary-only). */
2408
+ readonly seriesLabel: string;
2409
+ /** Resolved CSS color for this series (categorical[i] cycling already applied). */
2410
+ readonly seriesColor: string;
2411
+ readonly pointerX: number;
2412
+ readonly pointerY: number;
2413
+ readonly containerWidth: number;
2414
+ readonly containerHeight: number;
2415
+ readonly theme: Theme;
2416
+ readonly palette: Palette;
2417
+ readonly locale: string;
2418
+ readonly timeZone: string | undefined;
2419
+ readonly formatter: ChartFormatter;
2420
+ }
2421
+
2422
+ declare interface ScatterPoint {
2423
+ readonly x: number;
2424
+ readonly y: number;
2425
+ /** Optional 3rd dimension - only consumed when `pointSize` is data-driven. */
2426
+ readonly size?: number;
2427
+ }
2428
+
2429
+ /** Multi-series ScatterChart entry. Always supported.
2430
+ * Without per-series `color`, the lib auto-cycles `palette.categorical[i]`. */
2431
+ declare interface ScatterSeriesConfig {
2432
+ readonly id: string;
2433
+ readonly data: ScatterSeriesInput;
2434
+ readonly label?: string;
2435
+ readonly color?: string;
2436
+ }
2437
+
2438
+ /** AoS or SoA - host picks. SoA is zero-copy on ingest. */
2439
+ declare type ScatterSeriesInput = {
2440
+ readonly points: readonly ScatterPoint[];
2441
+ } | {
2442
+ readonly xs: Float64Array;
2443
+ readonly ys: Float64Array;
2444
+ readonly sizes?: Float64Array;
2445
+ };
2446
+
2447
+ declare interface SequentialConfig {
2448
+ readonly type: "sequential";
2449
+ /** `[low, high]` data range. When omitted, auto-fits to data extent. */
2450
+ readonly domain?: readonly [number, number];
2451
+ }
2452
+
2453
+ /** Multi-series config - one entry per line on the chart.
2454
+ * Each entry can override the chart-level
2455
+ * curveType / lineWidth / lineDash / lineDashSpacing / pointMarkers for
2456
+ * this one series. Without a per-series `color`, lib auto-cycles
2457
+ * `palette.categorical[i]`. */
2458
+ export declare interface SeriesConfig {
2459
+ readonly id: string;
2460
+ readonly data: LineSeriesInput;
2461
+ readonly label?: string;
2462
+ readonly color?: string;
2463
+ readonly curveType?: CurveType;
2464
+ readonly stepEdgeRadius?: number;
2465
+ readonly lineWidth?: number;
2466
+ readonly lineDash?: LineDash;
2467
+ readonly lineDashSpacing?: number;
2468
+ readonly pointMarkers?: PointMarkers;
2469
+ }
2470
+
2471
+ /** Should the chart engage the offscreen-worker render path? */
2472
+ export declare function shouldEngageOffscreenWorker(ctx: OffscreenContext): boolean;
2473
+
2474
+ /** Decide whether the chart should engage the WebGL2 renderer.
2475
+ * Returns false when WebGL2 is unavailable in this environment. */
2476
+ export declare function shouldEngageWebgl(ctx: GpuEngageContext): boolean;
2477
+
2478
+ /** Centralised decision - should this chart use partial dirty-rect
2479
+ * repaints? Same threshold as the two-layer split for consistency. */
2480
+ export declare function shouldUseDirtyRects(cssWidth: number, cssHeight: number): boolean;
2481
+
2482
+ /** Decide whether to engage the two-canvas split. Returns `false` when
2483
+ * the chart is too small or in sparkline mode; `true` otherwise. */
2484
+ export declare function shouldUseLayerSplit(opts: LayerSplitOptions): boolean;
2485
+
2486
+ declare interface SignalMarker {
2487
+ /** Time in ms (matches a candle's t). */
2488
+ t: number;
2489
+ side: SignalSide;
2490
+ /** [0, 1] confidence - drives the marker size scale. */
2491
+ confidence?: number;
2492
+ /** Optional override for the chart's `signalTooltip` data. */
2493
+ meta?: Record<string, unknown>;
2494
+ }
2495
+
2496
+ declare type SignalSide = "buy" | "sell";
2497
+
2498
+ declare interface SignalTooltipProps {
2499
+ marker: SignalMarker;
2500
+ pointerX: number;
2501
+ pointerY: number;
2502
+ formatter: ChartFormatter;
2503
+ }
2504
+
2505
+ export declare interface SliceLabelData {
2506
+ readonly name: string;
2507
+ readonly value: number;
2508
+ /** 0–1 fraction of the total. */
2509
+ readonly percent: number;
2510
+ }
2511
+
2512
+ declare interface SmallSliceConfig {
2513
+ /** 0-1 fraction of total. */
2514
+ readonly threshold: number;
2515
+ readonly label?: string;
2516
+ /** `'auto'` resolves to a darker neutral at draw time. */
2517
+ readonly color?: "auto" | string;
2518
+ }
2519
+
2520
+ export declare type SmallSliceThresholdInput = false | number | SmallSliceConfig;
2521
+
2522
+ export declare type SortOrder = "value-desc" | "value-asc" | "data-order" | "alphabetical";
2523
+
2524
+ export declare const SPLIT_MIN_PX = 200;
2525
+
2526
+ export declare type SpreadDisplayInput = false | true | "pill" | "inline";
2527
+
2528
+ export declare type SpreadDisplayMode = "off" | "pill" | "inline";
2529
+
2530
+ export declare type StackingMode = false | true | "normalized";
2531
+
2532
+ export declare type StaleBannerProp = boolean | ((props: StaleBannerRenderProps) => JSX.Element);
2533
+
2534
+ export declare interface StaleBannerRenderProps {
2535
+ state: LiveState;
2536
+ liveSince: number | undefined;
2537
+ theme: Theme;
2538
+ palette: Palette;
2539
+ }
2540
+
2541
+ /** Chart-wide stale-state visual treatment. */
2542
+ declare type StaleVisualization = "none" | "desaturate-pulse" | "banner" | "desaturate-pulse + banner";
2543
+
2544
+ export declare class StaticLayerCache {
2545
+ private cachedKey;
2546
+ private cachedSurface;
2547
+ /** Stats - flips a counter every hit / miss for benchmark + dev
2548
+ * inspection. Auditable side-effect. */
2549
+ private hits;
2550
+ private misses;
2551
+ /** Returns the cached surface when `key` matches the prior call.
2552
+ * Returns null on miss; caller paints into the surface returned by
2553
+ * `acquireSurface(w, h, dpr)` next. */
2554
+ lookup(key: StaticLayerCacheKey): HTMLCanvasElement | null;
2555
+ /** Acquire (or recycle) the offscreen surface the caller will paint
2556
+ * into. Always recreated on size/DPR change (cheaper than scaling). */
2557
+ acquireSurface(cssWidth: number, cssHeight: number, dpr: number): HTMLCanvasElement;
2558
+ /** Commit the current surface to the cache under `key`. Caller calls
2559
+ * this after painting. */
2560
+ commit(key: StaticLayerCacheKey): void;
2561
+ /** Force a miss on the next lookup. */
2562
+ invalidate(): void;
2563
+ /** Inspection - useful for benches + dev audit. */
2564
+ stats(): {
2565
+ readonly hits: number;
2566
+ readonly misses: number;
2567
+ };
2568
+ }
2569
+
2570
+ export declare interface StaticLayerCacheKey {
2571
+ readonly cssWidth: number;
2572
+ readonly cssHeight: number;
2573
+ readonly dpr: number;
2574
+ readonly themeFingerprint: string;
2575
+ readonly dataFingerprint: string;
2576
+ /** Hosts can suffix any extra state that affects the static layer. */
2577
+ readonly extra: string;
2578
+ }
2579
+
2580
+ declare interface StochasticSpecInput extends IndicatorPaneCommon {
2581
+ type: "stochastic";
2582
+ kPeriod?: number;
2583
+ dPeriod?: number;
2584
+ smoothing?: number;
2585
+ overbought?: number;
2586
+ oversold?: number;
2587
+ }
2588
+
2589
+ export declare function SunburstChart(props: SunburstChartProps): JSX.Element;
2590
+
2591
+ declare interface SunburstChartBaseProps {
2592
+ /** Root hierarchy - a tree of `{ name, value?, children? }`. The
2593
+ * chart renders concentric rings, one per depth level. */
2594
+ data?: HierarchyNode;
2595
+ /** Default 'uniform'. */
2596
+ radiusProportion?: RadiusProportion;
2597
+ /** Default 'horizontal'. */
2598
+ labelRotation?: LabelRotation;
2599
+ /** Default false. Same shape as DonutChart's centerLabel. */
2600
+ centerLabel?: boolean | string;
2601
+ /** Inherited from PieChart-related axes - gap between slices. Default 1°. */
2602
+ padAngle?: number;
2603
+ /** Inherited from TreemapChart axes. */
2604
+ labelBehavior?: LabelBehavior;
2605
+ labelContent?: LabelContentInput;
2606
+ depthLimit?: DepthLimitInput;
2607
+ colorScale?: TreemapColorScale;
2608
+ viewMode?: ViewMode;
2609
+ breadcrumb?: boolean;
2610
+ currentPath?: readonly string[];
2611
+ onPathChange?: (path: readonly string[]) => void;
2612
+ legend?: LegendVisibility;
2613
+ legendPosition?: LegendPosition;
2614
+ crosshairVisible?: boolean;
2615
+ crosshairLineStyle?: GridStyle;
2616
+ crosshairMarker?: CrosshairMarker;
2617
+ width?: number;
2618
+ height?: number;
2619
+ theme?: ThemeInput;
2620
+ palette?: string;
2621
+ visualStyle?: "Fill" | "Outline";
2622
+ outlineFillColor?: "auto" | string;
2623
+ outlineFillOpacity?: number;
2624
+ pixelDensityCap?: number;
2625
+ fastMode?: boolean;
2626
+ /** Glow + glow-color axes. */
2627
+ glow?: GlowInput;
2628
+ glowColor?: GlowColorInput;
2629
+ /** Pattern fills. */
2630
+ pattern?: PatternInput;
2631
+ patternScale?: number;
2632
+ patternColor?: PatternColorInput;
2633
+ ariaLabel?: string;
2634
+ accents?: boolean;
2635
+ locale?: string;
2636
+ timeZone?: string;
2637
+ cornerRadius?: number;
2638
+ borderWidth?: number;
2639
+ digitGrouping?: DigitGrouping;
2640
+ numberAbbreviation?: NumberAbbreviation;
2641
+ decimalPlaces?: DecimalPlaces;
2642
+ currency?: string;
2643
+ currencyDisplay?: CurrencyDisplay;
2644
+ percentPrecision?: PercentPrecision;
2645
+ dateFormat?: DateFormat;
2646
+ timeFormat?: TimeFormat;
2647
+ }
2648
+
2649
+ export declare interface SunburstChartProps extends SunburstChartBaseProps {
2650
+ tooltip?: SunburstChartTooltipProp;
2651
+ }
2652
+
2653
+ export declare type SunburstChartTooltipProp = undefined | false | ((props: SunburstChartTooltipProps) => JSX.Element);
2654
+
2655
+ export declare interface SunburstChartTooltipProps {
2656
+ readonly idx: number;
2657
+ readonly name: string;
2658
+ readonly value: number;
2659
+ readonly percent: number;
2660
+ readonly depth: number;
2661
+ readonly path: readonly string[];
2662
+ readonly color: string;
2663
+ readonly pointerX: number;
2664
+ readonly pointerY: number;
2665
+ readonly containerWidth: number;
2666
+ readonly containerHeight: number;
2667
+ readonly theme: Theme;
2668
+ readonly palette: Palette;
2669
+ readonly locale: string;
2670
+ readonly timeZone: string | undefined;
2671
+ readonly formatter: ChartFormatter;
2672
+ }
2673
+
2674
+ export declare type SyncYScale = "off" | "percent" | "absolute";
2675
+
2676
+ declare type Theme = "light" | "dark";
2677
+
2678
+ declare type ThemeInput = "inherit" | "light" | "dark" | "system";
2679
+
2680
+ export declare type ThresholdFill = false | true | ThresholdFillConfig;
2681
+
2682
+ export declare interface ThresholdFillConfig {
2683
+ value?: number;
2684
+ aboveColor?: string;
2685
+ belowColor?: string;
2686
+ }
2687
+
2688
+ export declare type TileLayout = "squarify" | "slice-and-dice" | "strip" | "slice" | "dice" | "binary";
2689
+
2690
+ declare type TimeFormat = "auto" | "24h" | "12h";
2691
+
2692
+ export declare type TimeOffSource = "close" | "high-low";
2693
+
2694
+ export declare interface TimeRange {
2695
+ readonly start: number;
2696
+ readonly end: number;
2697
+ }
2698
+
2699
+ /** Per-palette declaration of the tonal-symmetry rule.
2700
+ * When `'positive'` or `'negative'`, the
2701
+ * chosen direction renders with the opposite-direction's color as
2702
+ * its stroke and a fully-transparent interior (regardless of
2703
+ * `visualStyle`). The non-chosen direction renders normally per
2704
+ * `visualStyle`. `'none'` disables the rule - both directions render
2705
+ * by their own palette color per `visualStyle`. */
2706
+ declare type TonalSymmetrySide = "positive" | "negative" | "none";
2707
+
2708
+ /** Canonical list of tooltip-slot names the lib exposes.
2709
+ * Stored for audit + documentation; not used at runtime. */
2710
+ export declare const TOOLTIP_SLOT_NAMES: readonly ["tooltip", "markerTooltip", "signalTooltip", "orderTooltip", "positionTooltip", "eventTooltip", "drawingTooltip", "extremeTooltip", "volumeBarTooltip", "livePriceLineTooltip", "indicatorTooltip"];
2711
+
2712
+ /** A tooltip slot's polymorphic input form. Used uniformly across
2713
+ * every tooltip prop (`tooltip`, `markerTooltip`, `signalTooltip`,
2714
+ * `orderTooltip`, `positionTooltip`, `eventTooltip`, `drawingTooltip`,
2715
+ * `extremeTooltip`, `volumeBarTooltip`, `livePriceLineTooltip`,
2716
+ * `indicatorTooltip`). Generic `P` is the chart-specific tooltip
2717
+ * props extending `BaseTooltipProps`. */
2718
+ export declare type TooltipInput<P> = false | true | ((props: P) => unknown);
2719
+
2720
+ /** Per-series value at the hover-x. Every visible
2721
+ * series shows its value at the cursor in multi-series mode. */
2722
+ export declare interface TooltipSeriesValue {
2723
+ readonly id: string;
2724
+ readonly label: string;
2725
+ readonly color: string;
2726
+ readonly value: number;
2727
+ }
2728
+
2729
+ export declare type TooltipSlotName = (typeof TOOLTIP_SLOT_NAMES)[number];
2730
+
2731
+ /** Reusable transferable-list builder. Caller passes the typed arrays
2732
+ * whose backing buffers should be transferred (zero-copy), and we
2733
+ * return the `Transferable[]` array `postMessage` consumes. */
2734
+ export declare function transferablesFor(arrs: readonly ArrayBufferView[]): Transferable[];
2735
+
2736
+ export declare function TreemapChart(props: TreemapChartProps): JSX.Element;
2737
+
2738
+ declare interface TreemapChartBaseProps {
2739
+ /** Root hierarchy - `{ name, value?, children? }`. The chart packs
2740
+ * children into rectangles proportional to their value. */
2741
+ data?: HierarchyNode;
2742
+ /** Default 'squarify'. */
2743
+ tileLayout?: TileLayout;
2744
+ /** Default 2 px. */
2745
+ tilePadding?: number;
2746
+ /** Default 4 px. */
2747
+ parentChildPadding?: number;
2748
+ /** Default 'auto'. */
2749
+ labelBehavior?: LabelBehavior;
2750
+ /** Default 'name + percent'. */
2751
+ labelContent?: LabelContentInput;
2752
+ /** Default 'all'. */
2753
+ depthLimit?: DepthLimitInput;
2754
+ /** Default 'flat-categorical'. */
2755
+ colorScale?: TreemapColorScale;
2756
+ /** Default 'nested'. */
2757
+ viewMode?: ViewMode;
2758
+ /** Default true (drill-down only). */
2759
+ breadcrumb?: boolean;
2760
+ /** Controlled-mode current path (drill-down only). When omitted, the
2761
+ * controller manages an internal session-state path. */
2762
+ currentPath?: readonly string[];
2763
+ /** Controlled-mode change handler. Required if `currentPath` is set. */
2764
+ onPathChange?: (path: readonly string[]) => void;
2765
+ legend?: LegendVisibility;
2766
+ legendPosition?: LegendPosition;
2767
+ crosshairVisible?: boolean;
2768
+ crosshairLineStyle?: GridStyle;
2769
+ crosshairMarker?: CrosshairMarker;
2770
+ width?: number;
2771
+ height?: number;
2772
+ theme?: ThemeInput;
2773
+ palette?: string;
2774
+ visualStyle?: "Fill" | "Outline";
2775
+ outlineFillColor?: "auto" | string;
2776
+ outlineFillOpacity?: number;
2777
+ pixelDensityCap?: number;
2778
+ fastMode?: boolean;
2779
+ /** Glow + glow-color axes. */
2780
+ glow?: GlowInput;
2781
+ glowColor?: GlowColorInput;
2782
+ /** Pattern fills. */
2783
+ pattern?: PatternInput;
2784
+ patternScale?: number;
2785
+ patternColor?: PatternColorInput;
2786
+ ariaLabel?: string;
2787
+ accents?: boolean;
2788
+ locale?: string;
2789
+ timeZone?: string;
2790
+ cornerRadius?: number;
2791
+ borderWidth?: number;
2792
+ digitGrouping?: DigitGrouping;
2793
+ numberAbbreviation?: NumberAbbreviation;
2794
+ decimalPlaces?: DecimalPlaces;
2795
+ currency?: string;
2796
+ currencyDisplay?: CurrencyDisplay;
2797
+ percentPrecision?: PercentPrecision;
2798
+ dateFormat?: DateFormat;
2799
+ timeFormat?: TimeFormat;
2800
+ }
2801
+
2802
+ export declare interface TreemapChartProps extends TreemapChartBaseProps {
2803
+ tooltip?: TreemapChartTooltipProp;
2804
+ }
2805
+
2806
+ export declare type TreemapChartTooltipProp = undefined | false | ((props: TreemapChartTooltipProps) => JSX.Element);
2807
+
2808
+ export declare interface TreemapChartTooltipProps {
2809
+ readonly idx: number;
2810
+ readonly name: string;
2811
+ readonly value: number;
2812
+ readonly percent: number;
2813
+ readonly depth: number;
2814
+ readonly path: readonly string[];
2815
+ readonly color: string;
2816
+ readonly pointerX: number;
2817
+ readonly pointerY: number;
2818
+ readonly containerWidth: number;
2819
+ readonly containerHeight: number;
2820
+ readonly theme: Theme;
2821
+ readonly palette: Palette;
2822
+ readonly locale: string;
2823
+ readonly timeZone: string | undefined;
2824
+ readonly formatter: ChartFormatter;
2825
+ }
2826
+
2827
+ export declare type TreemapColorScale = "flat-categorical" | "depth-gradient" | "value-heat" | "directional";
2828
+
2829
+ /** Try to obtain a WebGL2 context. Wraps the `getContext` call in
2830
+ * try/catch + reports `null` on any error so the chart can fall back
2831
+ * to canvas2d without crashing. */
2832
+ export declare function tryGetWebgl2(canvas: HTMLCanvasElement): WebGL2RenderingContext | null;
2833
+
2834
+ export declare function useChartGroup(): ChartGroupContextValue | null;
2835
+
2836
+ /** Returns an accessor - call as `ctx()` to read the current provider value.
2837
+ * Mirrors React's `useChartsContext()` shape semantically; in Solid the
2838
+ * return is a getter so reactivity propagates through the chart components. */
2839
+ export declare function useChartsContext(): () => ChartsProviderValue;
2840
+
2841
+ export declare function useChartTheme(perChartTheme?: ThemeInput): () => Theme;
2842
+
2843
+ export declare function useStreamingCandles(opts: UseStreamingCandlesOptions): UseStreamingCandlesResult;
2844
+
2845
+ export declare interface UseStreamingCandlesOptions {
2846
+ timeframeMinutes: number;
2847
+ market: MarketKind;
2848
+ capacity?: number;
2849
+ minPriceRaw: number;
2850
+ maxPriceRaw: number;
2851
+ maxVolumeRaw: number;
2852
+ anomalyPolicy?: {
2853
+ maxRelativePriceJump?: number;
2854
+ rejectZeroVolumeTrade?: boolean;
2855
+ clockSkewToleranceMs?: number;
2856
+ maxGapMs?: number;
2857
+ };
2858
+ onAudit?: (kind: number, tsMs: number, priceRaw: number, rejectReasonCode: number) => void;
2859
+ onTelemetry?: (name: string) => void;
2860
+ }
2861
+
2862
+ export declare interface UseStreamingCandlesResult {
2863
+ /** Accessor - call as `candles()` to read the latest snapshot. The
2864
+ * wrapping object is fresh per tick (so equality checks see the change),
2865
+ * but the underlying typed-array buffers are reused. */
2866
+ candles: Accessor<BinaryCandleSeriesInput>;
2867
+ /** Accessor for the current bar count. */
2868
+ length: Accessor<number>;
2869
+ pushTick: (tsMs: number, priceRaw: number, volumeRaw: number) => void;
2870
+ reset: () => void;
2871
+ /** Accessor - `true` once WASM is loaded; pre-init `pushTick` calls are
2872
+ * buffered and replayed once the engine is ready. */
2873
+ ready: Accessor<boolean>;
2874
+ }
2875
+
2876
+ export declare type ValueLabelPosition = "auto" | "inside" | "outside" | "top" | "bottom";
2877
+
2878
+ export declare type ValueLabels = false | true | LabelConfig;
2879
+
2880
+ export declare type ViewMode = "nested" | "drill-down";
2881
+
2882
+ export declare const VISIBLE_MARK_THRESHOLD = 50000;
2883
+
2884
+ declare type VisualStyle = "Fill" | "Outline";
2885
+
2886
+ /** Volume-bar tooltip render-prop param shape - framework-agnostic.
2887
+ * Mirrors `VolumeBarTooltipProps` in both `react/tooltips/default-volume-
2888
+ * bar-tooltip` and `solid/tooltips/default-volume-bar-tooltip`. The
2889
+ * controller's `volumeBarTooltip` widens the return type to `unknown`
2890
+ * so both the React adapter (`React.ReactNode`) and the Solid adapter
2891
+ * (`JSX.Element`) pass type-check via covariance. */
2892
+ export declare interface VolumeBarTooltipProps {
2893
+ bar: {
2894
+ t: number;
2895
+ v: number;
2896
+ idx: number;
2897
+ };
2898
+ avg20: number;
2899
+ percentile: number;
2900
+ pointerX: number;
2901
+ pointerY: number;
2902
+ containerWidth: number;
2903
+ containerHeight: number;
2904
+ theme: Theme;
2905
+ palette: Palette;
2906
+ locale: string;
2907
+ timeZone: string | undefined;
2908
+ formatter: ChartFormatter;
2909
+ }
2910
+
2911
+ export declare type VolumeColoring = "by-direction" | "single" | "by-magnitude";
2912
+
2913
+ export declare type VolumePlacement = "subpane" | "overlay";
2914
+
2915
+ export declare type VolumeScale = "linear" | "log";
2916
+
2917
+ export declare type WheelBehavior =
2918
+ /** Mouse-wheel zooms (default). Hosts may flip to scroll-only. */
2919
+ "zoom"
2920
+ /** Wheel scrolls the page; charts ignore wheel. */
2921
+ | "scroll"
2922
+ /** Wheel zooms only with the modifier key held. */
2923
+ | "ctrl-zoom";
2924
+
2925
+ export declare type WickColor = "body" | "neutral" | string;
2926
+
2927
+ /** Host → worker. The host transfers the `OffscreenCanvas` reference
2928
+ * once during `init`; subsequent paints reuse the same canvas. Numeric
2929
+ * buffers are transferable typed arrays. */
2930
+ export declare type WorkerInput = {
2931
+ readonly kind: "init";
2932
+ readonly canvas: OffscreenCanvas;
2933
+ readonly dpr: number;
2934
+ } | {
2935
+ readonly kind: "resize";
2936
+ readonly cssWidth: number;
2937
+ readonly cssHeight: number;
2938
+ readonly dpr: number;
2939
+ } | {
2940
+ readonly kind: "paint";
2941
+ readonly times: Float64Array;
2942
+ readonly values: Float64Array;
2943
+ readonly payload: Record<string, unknown>;
2944
+ } | {
2945
+ readonly kind: "dispose";
2946
+ };
2947
+
2948
+ /** Worker → host. The host updates UI based on these. */
2949
+ export declare type WorkerOutput = {
2950
+ readonly kind: "ready";
2951
+ } | {
2952
+ readonly kind: "painted";
2953
+ readonly frameMs: number;
2954
+ } | {
2955
+ readonly kind: "error";
2956
+ readonly message: string;
2957
+ };
2958
+
2959
+ declare type XAxisPosition = "top" | "bottom";
2960
+
2961
+ export declare type YAxisMode = "frequency" | "density" | "cumulative";
2962
+
2963
+ declare type YAxisPosition = "left" | "right";
2964
+
2965
+ export declare type ZoomAnchor =
2966
+ /** Anchor at the mouse / touch position (default). */
2967
+ "pointer"
2968
+ /** Anchor at the chart center. */
2969
+ | "center";
2970
+
2971
+ export { }