@luxalgo/vela 0.5.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.
Files changed (61) hide show
  1. package/LICENSE +201 -0
  2. package/NOTICE +28 -0
  3. package/README.md +135 -0
  4. package/dist/DataProvider-DKNDHpNv.d.cts +134 -0
  5. package/dist/DataProvider-Dzd-Erlk.d.ts +134 -0
  6. package/dist/chunk-7UFX5ZIG.js +5976 -0
  7. package/dist/chunk-GYD2THPV.js +252 -0
  8. package/dist/chunk-KCCZNKH7.js +19137 -0
  9. package/dist/chunk-KM6LHB3Y.js +76 -0
  10. package/dist/chunk-OVQKKXLZ.js +3978 -0
  11. package/dist/chunk-Q3XQHLIH.js +7 -0
  12. package/dist/chunk-RHIDOUFL.js +698 -0
  13. package/dist/contributions-hX3EUyjG.d.ts +1528 -0
  14. package/dist/contributions-o1GRKPI_.d.cts +1528 -0
  15. package/dist/history-Dzxz-MQj.d.ts +298 -0
  16. package/dist/history-LJkz4-sS.d.cts +298 -0
  17. package/dist/icons-BZYbJXSV.d.cts +10 -0
  18. package/dist/icons-BZYbJXSV.d.ts +10 -0
  19. package/dist/index.cjs +25294 -0
  20. package/dist/index.d.cts +1189 -0
  21. package/dist/index.d.ts +1189 -0
  22. package/dist/index.js +5 -0
  23. package/dist/keymap-CGOz5F5f.d.cts +64 -0
  24. package/dist/keymap-CGOz5F5f.d.ts +64 -0
  25. package/dist/options-Q-576hIi.d.cts +1545 -0
  26. package/dist/options-Q-576hIi.d.ts +1545 -0
  27. package/dist/plugin-D94muTV-.d.cts +405 -0
  28. package/dist/plugin-aGUD1epn.d.ts +405 -0
  29. package/dist/plugin.cjs +5967 -0
  30. package/dist/plugin.d.cts +7 -0
  31. package/dist/plugin.d.ts +7 -0
  32. package/dist/plugin.js +3 -0
  33. package/dist/providers/binance.cjs +390 -0
  34. package/dist/providers/binance.d.cts +62 -0
  35. package/dist/providers/binance.d.ts +62 -0
  36. package/dist/providers/binance.js +388 -0
  37. package/dist/providers/coinbase.cjs +462 -0
  38. package/dist/providers/coinbase.d.cts +59 -0
  39. package/dist/providers/coinbase.d.ts +59 -0
  40. package/dist/providers/coinbase.js +460 -0
  41. package/dist/providers/hyperliquid.cjs +361 -0
  42. package/dist/providers/hyperliquid.d.cts +54 -0
  43. package/dist/providers/hyperliquid.d.ts +54 -0
  44. package/dist/providers/hyperliquid.js +359 -0
  45. package/dist/side-panel-CT9ZwIGz.d.cts +63 -0
  46. package/dist/side-panel-CT9ZwIGz.d.ts +63 -0
  47. package/dist/ui.cjs +1030 -0
  48. package/dist/ui.d.cts +188 -0
  49. package/dist/ui.d.ts +188 -0
  50. package/dist/ui.js +3 -0
  51. package/dist/vela.global.js +26509 -0
  52. package/dist/vela.global.min.js +230 -0
  53. package/dist/widget.cjs +31178 -0
  54. package/dist/widget.d.cts +799 -0
  55. package/dist/widget.d.ts +799 -0
  56. package/dist/widget.js +1060 -0
  57. package/dist/workspace.cjs +31692 -0
  58. package/dist/workspace.d.cts +579 -0
  59. package/dist/workspace.d.ts +579 -0
  60. package/dist/workspace.js +1694 -0
  61. package/package.json +95 -0
@@ -0,0 +1,1189 @@
1
+ import { D as DrawingsDocument, R as Resolved } from './contributions-hX3EUyjG.js';
2
+ export { B as BarsChangeReason, C as ContextSelect, b as DataControl, c as DrawingsControl, E as EngineAlert, d as EngineCapabilities, e as EngineContextSnapshot, f as EngineFactory, g as EngineWarning, h as ExecutionHandlers, i as ExecutionMarket, j as ExecutionRequest, k as ExecutionSession, F as FetchSeries, l as IndicatorEventMap, I as IndicatorHandle, m as IndicatorSummary, L as LegendActionDescriptor, n as LegendIndicatorInfo, N as NativeIndicator, o as NativeIndicatorContext, p as NativeIndicatorDescriptor, q as NativeIndicatorInfo, r as NativeIndicatorOutput, P as ParsedSymbol, s as PreparedScript, t as RendererControl, u as RunIndicatorResult, v as SceneInspection, a as ScriptRun, w as ScriptRunCause, x as ScriptRunResult, S as ScriptingEngine, y as SidePanelButton, z as SidePanelDescriptor, A as SidePanelHandle, G as SidePanelHeader, H as StrategyFill, J as StrategyState, K as StrategyTrade, T as TypedEventBus, V as Vela, M as VelaDeps, O as VelaEventMap, Q as VisibleBarRange, U as WidgetActionDescriptor, X as WidgetActionTarget, Y as WidgetAttachment, W as WidgetContext, Z as getNativeIndicator, _ as legendActions, $ as nativeIndicatorDescriptors, a0 as nativeIndicatorTypes, a1 as registerDefaultEngine, a2 as registerLegendAction, a3 as registerNativeIndicator, a4 as registerSidePanel, a5 as registerWidgetAction, a6 as registerWidgetAttachment, a7 as resolveEngines, a8 as sidePanels, a9 as unregisterDefaultEngine, aa as unregisterLegendAction, ab as unregisterNativeIndicator, ac as unregisterSidePanel, ad as unregisterWidgetAction, ae as unregisterWidgetAttachment, af as widgetActions, ag as widgetAttachments } from './contributions-hX3EUyjG.js';
3
+ import { D as Drawing, S as SerializedDrawing, U as Unsubscribe, L as LineStyle, P as PriceStyle, I as IChartRenderer, R as RendererCapabilities, d as RendererDisplayOptions, e as IndicatorRenderHandle, f as IndicatorStatus, c as VelaTheme, O as OHLCV, g as Pane, h as PaneAction, i as MoveTarget, j as IndicatorModel, k as ScenePatch, l as InputValue, m as SymbolPickerFn, n as LegendActionView, o as InputChangeEvent, T as ThemeName, C as CrosshairEvent, p as ClickEvent, a as VisibleRange, q as DataWindowReadout, r as IDrawingsRendererPort, s as Millis, t as SnapMode, u as DrawingTypeKey, v as ToolbarDefinition, M as MarketConfig } from './options-Q-576hIi.js';
4
+ export { A as AddIndicatorOptions, B as Background, w as BoxFontFamily, x as BoxHAlign, y as BoxTextSize, z as BoxVAlign, E as CandleBarColor, F as CandleSeries, G as CandleStyle, H as DataWindowGroup, J as DataWindowOHLC, K as DataWindowRow, Q as DirtyRange, W as DrawingBox, X as DrawingExtend, Y as DrawingIntent, Z as DrawingLabel, _ as DrawingLine, $ as DrawingLinefill, a0 as DrawingMode, a1 as DrawingPoint, a2 as DrawingPolyline, a3 as DrawingStyle, a4 as DrawingTable, a5 as DrawingText, a6 as DrawingXLoc, a7 as DrawingsOption, a8 as Fill, a9 as FillGradientStop, aa as IndicatorMeta, ab as InputSchema, ac as InputType, ad as LabelStyle, ae as LabelYLoc, af as LineLikeKind, ag as LineLikeSeries, ah as LineLikeStyle, ai as MarkerPoint, aj as MarkerSeries, ak as MarketSnapshot, al as MarketSwitch, am as PaneHint, an as PaneKind, ao as PolylinePoint, ap as PriceLine, aq as Projector, ar as ProviderName, as as RendererConstructor, at as Scene, au as SchemaPatch, av as SeriesKind, aw as SeriesPoint, ax as SeriesSpec, ay as SeriesValueDelta, az as SettingsField, aA as SettingsSchema, aB as TableCell, aC as TableMerge, aD as TablePosition, aE as ToolbarGroupConfig, aF as TradeExecution, aG as ValuePatch, b as VelaOptions, V as VisibleRangePreset, aH as buildToolbar, aI as defaultToolbar } from './options-Q-576hIi.js';
5
+ import { M as MarketDataFeed, D as DataProvider, P as ProviderInfo, a as SymbolDescriptor, S as SymbolInfo, b as ProviderCapabilities, B as BarRange } from './DataProvider-Dzd-Erlk.js';
6
+ export { A as ACCENT, a as ACCENT_BRIGHT, B as BEARISH, b as BULLISH, c as BarTransform, C as CATEGORICAL, d as CROSSHAIR, e as ChartTypeDefinition, f as ChartTypeSettingsSection, D as DrawingTypeMeta, H as HIGHLIGHT, I as INFO, g as INVALID, h as IdentifiableKind, M as MARKER, N as NEUTRAL, R as RendererLayerArgs, i as RendererLayerDefinition, j as RendererLayerInstance, S as SERIES_LINE, k as SESSION_OFF, l as SESSION_POST, m as SESSION_PRE, n as SLATE, o as SLATE_DEEP, p as SeriesDataEngine, q as SeriesDataEngineHost, r as SettingsRowDescriptor, T as TRADE_EXIT, s as TRADE_LONG, t as TRADE_SHORT, V as VALID, W as WARNING, u as categoricalColor, v as chartType, w as chartTypes, x as createDrawing, y as deserializeDrawing, z as drawingTypes, E as getDrawingType, F as registerChartType, G as registerDrawingType, J as registerRendererDefaults, K as registerRendererLayer, L as rendererDefaults, O as rendererLayers, P as stableSeriesId, Q as tickerModifierIds, U as unregisterChartType, X as unregisterRendererDefaults, Y as unregisterRendererLayer } from './plugin-aGUD1epn.js';
7
+ export { D as DEFAULT_PANEL_MAX_WIDTH, a as DEFAULT_PANEL_MIN_WIDTH, b as DEFAULT_PANEL_WIDTH, S as SidePanelOptions, c as clampPanelWidth } from './side-panel-CT9ZwIGz.js';
8
+ export { i as iconMarkup, r as registerIcon } from './icons-BZYbJXSV.js';
9
+ export { a as KeyBindingDescriptor, R as ResolvedBinding } from './keymap-CGOz5F5f.js';
10
+
11
+ /**
12
+ * The single source of truth for a chart's user drawings. Owns identity + paint
13
+ * order (z), exposes CRUD + persistence, and fires `onChange` so the controller
14
+ * re-syncs the renderer. Renderer-agnostic — holds {@link Drawing} instances, but
15
+ * everything that leaves is plain {@link SerializedDrawing} data.
16
+ */
17
+ declare class DrawingStore {
18
+ private readonly byId;
19
+ private seq;
20
+ private zCounter;
21
+ private readonly listeners;
22
+ /** Allocate a unique, stable drawing id. */
23
+ nextId(): string;
24
+ /** Insert a drawing, assigning a mount-order z (later ⇒ painted in front) when it carries
25
+ * none. The counter only ever grows, so the fallback stays the front among drawings even
26
+ * after explicit keys landed below it. */
27
+ add(d: Drawing): Drawing;
28
+ remove(id: string): boolean;
29
+ get(id: string): Drawing | undefined;
30
+ has(id: string): boolean;
31
+ /** Apply a (possibly partial) record onto an existing drawing in place. */
32
+ update(id: string, patch: Partial<SerializedDrawing>): Drawing | null;
33
+ /** Every drawing in paint order (ascending z). */
34
+ all(): Drawing[];
35
+ /** Drawings on one pane, in paint order. */
36
+ byPane(paneId: string): Drawing[];
37
+ /** Raise over every drawing — and over `floorZ`, the top of the pane's series stack when
38
+ * the renderer shares one z space with it, so "front" beats the candles too. */
39
+ bringToFront(id: string, floorZ?: number): void;
40
+ /** Drop under every drawing — and under `ceilZ`, the bottom of the pane's series stack,
41
+ * so "back" lands behind the candles and the indicators, not just other drawings. */
42
+ sendToBack(id: string, ceilZ?: number): void;
43
+ setLocked(id: string, v: boolean): void;
44
+ setVisible(id: string, v: boolean): void;
45
+ clear(): void;
46
+ serialize(): DrawingsDocument;
47
+ /** Replace all drawings from a (validated) document. Unknown types are skipped. */
48
+ load(doc: unknown): void;
49
+ onChange(cb: () => void): Unsubscribe;
50
+ /** Keep `nextId()` from colliding with a loaded `dw-N` id. */
51
+ private bumpSeqPast;
52
+ private emit;
53
+ }
54
+
55
+ /** Price-axis display mode: absolute price, percent change vs a visible baseline, or
56
+ * values indexed to 100 at that same baseline (`index = price / baseline * 100`). */
57
+ type ScaleMode = 'price' | 'percent' | 'indexed';
58
+
59
+ interface GridLineStyle {
60
+ visible: boolean;
61
+ /** `null` ⇒ inherit `theme.gridColor`. */
62
+ color: string | null;
63
+ }
64
+ interface CrosshairStyle {
65
+ /** `null` ⇒ inherit `theme.textColor`. */
66
+ color: string | null;
67
+ width: number;
68
+ style: LineStyle;
69
+ /** Line opacity (0–1); reference charting crosshairs are translucent. */
70
+ opacity: number;
71
+ /** Axis-chip background; `null` ⇒ inherit `theme.textColor`. */
72
+ labelBackground: string | null;
73
+ }
74
+ interface CandleStyle {
75
+ /** Whether the filled candle body is drawn (off ⇒ wicks/borders only). */
76
+ bodyVisible: boolean;
77
+ borderVisible: boolean;
78
+ /** `null` ⇒ inherit the body color. */
79
+ borderUpColor: string | null;
80
+ borderDownColor: string | null;
81
+ wickVisible: boolean;
82
+ wickUpColor: string | null;
83
+ wickDownColor: string | null;
84
+ }
85
+ /**
86
+ * Per-price-style cosmetics — each chart type carries its OWN colors and does NOT
87
+ * inherit from another style. A `null` color is the style's "use the chart's
88
+ * up/down default" sentinel (so an untouched style still matches the candle palette
89
+ * and the prior rendering); set it and that style becomes independent. The candle
90
+ * BODY colors stay the renderer's `upColor`/`downColor` (the `candles` block adds
91
+ * border/wick on top); these four blocks cover the non-candle styles.
92
+ */
93
+ interface BarsStyle {
94
+ /** `null` ⇒ inherit the chart up color. */
95
+ upColor: string | null;
96
+ /** `null` ⇒ inherit the chart down color. */
97
+ downColor: string | null;
98
+ }
99
+ interface LineSeriesStyle {
100
+ /** `null` ⇒ inherit the chart up color. */
101
+ color: string | null;
102
+ width: number;
103
+ }
104
+ interface AreaSeriesStyle {
105
+ /** `null` ⇒ inherit the chart up color. */
106
+ lineColor: string | null;
107
+ width: number;
108
+ /** Gradient top (near the line); `null` ⇒ the resolved line color. */
109
+ topColor: string | null;
110
+ /** Gradient bottom (at the baseline); `null` ⇒ transparent. */
111
+ bottomColor: string | null;
112
+ }
113
+ interface BaselineSeriesStyle {
114
+ /** `null` ⇒ the baseline up default (`BASELINE_TOP_LINE`). */
115
+ topLineColor: string | null;
116
+ /** `null` ⇒ the baseline down default (`BASELINE_BOTTOM_LINE`). */
117
+ bottomLineColor: string | null;
118
+ /** Top area fill near the up line; `null` ⇒ a wash of the top line color at `BASELINE_FILL_ALPHA`. */
119
+ topFillColor: string | null;
120
+ /** Top area fill near the baseline (the lower end of the top area); `null` ⇒ a fainter
121
+ * wash of the top line color at `BASELINE_FILL_ALPHA_FAR`. */
122
+ topFillColor2: string | null;
123
+ /** Bottom area fill near the down line; `null` ⇒ a wash of the bottom line color at `BASELINE_FILL_ALPHA`. */
124
+ bottomFillColor: string | null;
125
+ /** Bottom area fill near the baseline (the upper end of the bottom area); `null` ⇒ a fainter
126
+ * wash of the bottom line color at `BASELINE_FILL_ALPHA_FAR`. */
127
+ bottomFillColor2: string | null;
128
+ width: number;
129
+ /** Baseline position as a percent of the visible pane price range (0 = low, 100 = high). */
130
+ baselineLevel: number;
131
+ }
132
+ interface ChartStyle {
133
+ /** Per-chart-type settings (plugin SDK sections), keyed by type id then row key. */
134
+ chartTypes: Record<string, Record<string, unknown>>;
135
+ /** Axis/label font size in CSS px (the family stays on the theme). */
136
+ fontSize: number;
137
+ gridVert: GridLineStyle;
138
+ gridHorz: GridLineStyle;
139
+ /** Axis frame lines (the right price-axis border); `null` ⇒ inherit `theme.borderColor`. */
140
+ borderColor: string | null;
141
+ /** The draggable line between stacked panes; `null` ⇒ inherit `theme.borderColor`. */
142
+ separatorColor: string | null;
143
+ crosshair: CrosshairStyle;
144
+ candle: CandleStyle;
145
+ bars: BarsStyle;
146
+ line: LineSeriesStyle;
147
+ area: AreaSeriesStyle;
148
+ baseline: BaselineSeriesStyle;
149
+ }
150
+ interface ChartConfig {
151
+ version: number;
152
+ layout: {
153
+ background: string;
154
+ textColor: string;
155
+ fontFamily: string;
156
+ fontSize: number;
157
+ };
158
+ grid: {
159
+ vertLines: {
160
+ visible: boolean;
161
+ color: string;
162
+ };
163
+ horzLines: {
164
+ visible: boolean;
165
+ color: string;
166
+ };
167
+ };
168
+ crosshair: {
169
+ color: string;
170
+ width: number;
171
+ style: LineStyle;
172
+ opacity: number;
173
+ labelBackground: string;
174
+ };
175
+ priceScale: {
176
+ mode: ScaleMode;
177
+ log: boolean;
178
+ /** Inverted price axis (high at the bottom). */
179
+ invert: boolean;
180
+ borderColor: string;
181
+ labelsVisible: boolean;
182
+ currentPriceLine: boolean;
183
+ priceLabel: boolean;
184
+ countdown: boolean;
185
+ };
186
+ /** Stacked-pane chrome — the draggable line between an indicator's pane and the one above it. */
187
+ panes: {
188
+ separatorColor: string;
189
+ };
190
+ /** Strategy trade markers (the `tradeMarkers` feature): the order-fill units on the price pane. */
191
+ trades: {
192
+ visible: boolean;
193
+ /** The order-id/comment text line. */
194
+ labels: boolean;
195
+ /** The signed-quantity text line. */
196
+ qty: boolean;
197
+ longColor: string;
198
+ shortColor: string;
199
+ exitColor: string;
200
+ };
201
+ timeScale: {
202
+ timezone: string;
203
+ };
204
+ /** Per-chart-type settings (plugin SDK sections), keyed by type id then row key. */
205
+ chartTypes: Record<string, Record<string, unknown>>;
206
+ candles: {
207
+ upColor: string;
208
+ downColor: string;
209
+ bodyVisible: boolean;
210
+ borderVisible: boolean;
211
+ borderUpColor: string;
212
+ borderDownColor: string;
213
+ wickVisible: boolean;
214
+ wickUpColor: string;
215
+ wickDownColor: string;
216
+ };
217
+ /** OHLC-bars style — its own up/down (independent of the candle body colors). */
218
+ bars: {
219
+ upColor: string;
220
+ downColor: string;
221
+ };
222
+ /** Line style — its own color + width. */
223
+ line: {
224
+ color: string;
225
+ width: number;
226
+ };
227
+ /** Area style — its own line + gradient-fill colors + width. */
228
+ area: {
229
+ lineColor: string;
230
+ width: number;
231
+ topColor: string;
232
+ bottomColor: string;
233
+ };
234
+ /** Baseline style — its own above/below line + two-stop fill colors + width + level. */
235
+ baseline: {
236
+ topLineColor: string;
237
+ bottomLineColor: string;
238
+ topFillColor: string;
239
+ topFillColor2: string;
240
+ bottomFillColor: string;
241
+ bottomFillColor2: string;
242
+ width: number;
243
+ baselineLevel: number;
244
+ };
245
+ series: {
246
+ style: PriceStyle;
247
+ baseline: number | null;
248
+ /** Spacing multiplier for non-connecting styles (candles/bars/HA/plugin types): scales the
249
+ * center-to-center pitch (and the crosshair step) without changing body width. 1 = default. */
250
+ spacing: number;
251
+ };
252
+ /** Draw-order keys — what paints in front of what. The candles' own key plus one per
253
+ * indicator id; user drawings persist their keys in the drawings document, in the same
254
+ * space, so a saved chart keeps a drawing under the candles or between two indicators. */
255
+ stacking: {
256
+ candles: number;
257
+ series: Record<string, number>;
258
+ };
259
+ }
260
+
261
+ /**
262
+ * The native renderer's chart-settings dialog (item 15): a DOM overlay, opened from
263
+ * an in-chart gear, that edits a curated slice of the serializable `ChartConfig`
264
+ * (background, candle/grid/crosshair colors, fonts, price scale, timezone, …). Each
265
+ * control emits a minimal nested patch via `onChange`; the renderer merges it onto
266
+ * the live config and repaints with NO indicator re-run. A footer exposes the whole
267
+ * config as JSON for export/import — the templating surface.
268
+ *
269
+ * It is renderer chrome (a positioned overlay on the chart container), kept
270
+ * dependency-free and themed to match the chart, mirroring `InputsUI`.
271
+ */
272
+ /** A host-contributed settings row: callback-based (the host owns the state).
273
+ * `heading` opens a titled group inside the tab (an in-pane section title). */
274
+ type HostSettingsRow = {
275
+ kind: 'heading';
276
+ label: string;
277
+ } | {
278
+ kind: 'toggle';
279
+ label: string;
280
+ get: () => boolean;
281
+ set: (v: boolean) => void;
282
+ } | {
283
+ kind: 'select';
284
+ label: string;
285
+ options: readonly string[];
286
+ get: () => string;
287
+ set: (v: string) => void;
288
+ };
289
+ /** A host-contributed settings tab (see `RendererControl.setSettingsSections`). */
290
+ interface HostSettingsSection {
291
+ title: string;
292
+ rows: readonly HostSettingsRow[];
293
+ /** Tab position: own tab after Symbol (default), end of the rail, or rows INSIDE
294
+ * the Symbol tab itself (`'symbol'` — e.g. the widget's watermark toggle). */
295
+ placement?: 'after-symbol' | 'end' | 'symbol';
296
+ }
297
+
298
+ /**
299
+ * The from-scratch "native" renderer (canvas2d backend in P0/P1/P2; hand-rolled
300
+ * WebGL2 added in P3 behind the same backend seam). P0 implements the full
301
+ * `IChartRenderer` surface but only the foundation is live: layered DOM, the
302
+ * shared CoordinateSystem, the invalidation scheduler, pane layout, and
303
+ * pointer/wheel pan-zoom over a placeholder grid. Series/fills/drawings/axes/
304
+ * crosshair/inputs land in P1–P2.
305
+ */
306
+ declare class NativeRenderer implements IChartRenderer {
307
+ readonly capabilities: RendererCapabilities;
308
+ private theme;
309
+ private surfaceBackground;
310
+ private surfaceTextColor;
311
+ private wrapper;
312
+ private plot;
313
+ private toolbarGutter;
314
+ private mountContainer;
315
+ private dataCanvas;
316
+ private volumeCanvas;
317
+ private vpvrCanvas;
318
+ private chromeCanvas;
319
+ private drawingsCanvas;
320
+ private cursorCanvas;
321
+ private overlayRoot;
322
+ private userDrawings;
323
+ private readonly volumeRenderer;
324
+ /** SDK renderer layers instantiated at mount ({@link registerRendererLayer}). */
325
+ private extLayers;
326
+ private attributionEl;
327
+ private attributionEnabled;
328
+ /** Host-supplied mark shown INSTEAD of the built-in one (`attribution: '<html>'`). */
329
+ private attributionHtml;
330
+ private readonly vpvrRenderer;
331
+ private resizeObserver;
332
+ private dprMedia;
333
+ private readonly coords;
334
+ private readonly scene;
335
+ private backend;
336
+ private backendMode;
337
+ private glowAmount;
338
+ private readonly chrome;
339
+ private readonly crosshairLayer;
340
+ private scheduler;
341
+ /** 1 Hz repaint pump so the price-axis countdown-to-bar-close ticks; null when off. */
342
+ private countdownTimer;
343
+ private animator;
344
+ private input;
345
+ private inputsUI;
346
+ private symbolPicker;
347
+ /** Indicator titles (the legend rows) shown — held here so a remount re-applies it. */
348
+ private indicatorTitlesOn;
349
+ /** Host-contributed legend actions — held here so a rebuild of the legend re-wires them. */
350
+ private legendActionsProvider;
351
+ private keyboard;
352
+ private keyboardEnabled;
353
+ /** Drawings layer self-serves Ctrl+Z/Y (see the `historyChords` feature). */
354
+ private historyChordsEnabled;
355
+ private liveRegion;
356
+ private animZoom;
357
+ private animPan;
358
+ private candleUp;
359
+ private candleDown;
360
+ private introStyle;
361
+ private introPlayed;
362
+ private introRaf;
363
+ /** The load affordance (three pulsing dots) — up while the host reports a bar load in
364
+ * flight with nothing painted (first load, market switch). Rebuilt per show, so it
365
+ * picks up the current theme without a setTheme hook. */
366
+ private loadingEl;
367
+ private modelAlpha;
368
+ private targetBarSpacing;
369
+ private zoomAnchorLogical;
370
+ private zoomAnchorX;
371
+ private zoomAnchorMode;
372
+ private panVelocity;
373
+ private bars;
374
+ private didInitialFit;
375
+ /** A data-tier paint has happened (scales + drawing resolvers are real) — gates the
376
+ * cheap chrome-only repaint so it never draws over placeholder state. */
377
+ private paintedData;
378
+ private skeletonClockMs;
379
+ private candleBodyAlpha;
380
+ private candleStructureAlpha;
381
+ private lastPointer;
382
+ private volumeActive;
383
+ private volumeHidden;
384
+ private vpvrActive;
385
+ private vpvrHidden;
386
+ private liveEaseTime;
387
+ private liveEaseHigh;
388
+ private liveEaseLow;
389
+ private liveEaseClose;
390
+ private axisDragEnabled;
391
+ private scaleDragHolder;
392
+ private scaleDragHeight;
393
+ private scaleDragStart;
394
+ private paneResizeEnabled;
395
+ private resizeAbove;
396
+ private resizeBelow;
397
+ private resizeSplitStart;
398
+ private hoverSeparatorY;
399
+ private maximizedPaneId;
400
+ private rightAxisW;
401
+ private paneControls;
402
+ private readonly paneActionCbs;
403
+ private hoverLogical;
404
+ private settingsDialog;
405
+ /** Where modal dialogs mount — a HOST override (multi-chart shells pass their root
406
+ * so dialogs center globally instead of clipping inside one cell). Null = the plot. */
407
+ private dialogHost;
408
+ private settingsButton;
409
+ private settingsEnabled;
410
+ private scrollButton;
411
+ private pointerNearScrollBtn;
412
+ private scrollTargetRO;
413
+ private scrollBtnBottomPx;
414
+ private scrollBtnRightPx;
415
+ private readonly viewportCbs;
416
+ private readonly crosshairCbs;
417
+ private readonly chartTypeSettingsCbs;
418
+ private readonly configChangedCbs;
419
+ /** The settings dialog's Canvas → Theme row raises the pick here; the host applies it. */
420
+ private readonly themeSelectCbs;
421
+ /** First-run config snapshot — what "Reset defaults" restores. */
422
+ private factoryConfig;
423
+ private hostSettingsSections;
424
+ private readonly clickCbs;
425
+ private readonly inputChangeCbs;
426
+ private readonly removeIndicatorCbs;
427
+ private readonly toggleVisibleCbs;
428
+ private readonly moveIndicatorCbs;
429
+ private readonly priceStyleCbs;
430
+ private readonly tableOverlays;
431
+ constructor(opts?: RendererDisplayOptions);
432
+ readonly name = "native";
433
+ readonly features: readonly string[];
434
+ /** Apply a render feature live — mutate the field + invalidate, no engine re-run. */
435
+ applyFeature(key: string, value: unknown): void;
436
+ readFeature(key: string): unknown;
437
+ /**
438
+ * Native-layer data push (see `setNativeData` on the port), keyed by native type. A chart-type
439
+ * indicator pushes its per-bar order-flow (revealed under the candles on zoom); the volume + VPVR
440
+ * indicators push their layer CONFIG only — both layers read the chart's bars each frame.
441
+ */
442
+ setNativeData(type: string, data: unknown): void;
443
+ /** Reflect an indicator's live status (loading / live / idle) in its legend row. */
444
+ setIndicatorStatus(handle: IndicatorRenderHandle, status: IndicatorStatus): void;
445
+ /**
446
+ * The host reports a bar load in flight with nothing painted (first load, market switch —
447
+ * see the port): three small dots pulse at the center of the plot. Web-Animations-driven,
448
+ * so no stylesheet crosses the renderer boundary; pointer-transparent, and removed (not
449
+ * hidden) on clear so a re-show picks up the current theme.
450
+ */
451
+ setLoading(loading: boolean): void;
452
+ /**
453
+ * Set the active symbol's tick size so the price axis shows the instrument's true
454
+ * precision (see the port). Undefined / non-positive ⇒ fall back to the zoom formula.
455
+ */
456
+ setPricePrecision(mintick: number | undefined): void;
457
+ /**
458
+ * Snapshot the full chart cosmetics as one serializable, versioned document.
459
+ * Every inherited value is resolved to a concrete one so an exported template
460
+ * stands on its own. Stable shape — safe to persist (localStorage) or share.
461
+ */
462
+ getConfig(): ChartConfig;
463
+ /**
464
+ * Apply a (possibly partial) config document — the inverse of `getConfig()`.
465
+ * Untrusted JSON is validated + merged onto the current config (`mergeConfig`),
466
+ * so malformed fields are dropped and a partial patch only changes what it names.
467
+ * Repaints with NO indicator re-run; safe to call live or before mount.
468
+ */
469
+ applyConfig(config: unknown): void;
470
+ /**
471
+ * Reorder one indicator's series layer. Accepts `{ id, to: 'front' | 'back' }`
472
+ * (relative to every layer incl. the candles) or `{ id, z }` (an explicit key).
473
+ */
474
+ private applySeriesOrder;
475
+ /** Toggle the in-chart settings gear + dialog (the `settings` feature). The gear
476
+ * sits above the time axis, clear of the right price-axis strip. */
477
+ private setSettingsEnabled;
478
+ private makeSettingsButton;
479
+ /** Port surface: hosts (bottom-bar / chrome buttons) open the same dialog as the
480
+ * in-chart gear — created on demand, independent of the gear feature being enabled. */
481
+ openSettingsDialog(section?: string): void;
482
+ /** (Re)aim the dialog's Canvas → Theme row: the current selection reflects the STABLE
483
+ * app-theme surface (not the plot background, which the config recolors
484
+ * independently); a pick is raised to the host (`onThemeSelect`), which owns the
485
+ * canonical theme. */
486
+ private syncThemeControl;
487
+ private toggleSettingsDialog;
488
+ /** Close the in-chart dialogs (indicator settings + chart-settings gear). No-op when none are open. */
489
+ closeDialogs(): void;
490
+ /** Jump-back-to-latest button — same size/border chrome as the drawing-toolbar collapse toggle. */
491
+ private makeScrollToRealtimeButton;
492
+ /** Double-chevron icon — the "jump back to the latest bar" affordance. */
493
+ private scrollButtonIcon;
494
+ /** The button's fill — the chart background at 50% so it blends with the plot beneath. */
495
+ private scrollButtonSurface;
496
+ /** Re-sync the scroll button's colors when `layout.background` changes — called from both
497
+ * `applyConfig` (playground path) and `setTheme` (app-theme swap). */
498
+ private refreshScrollButtonTheme;
499
+ /** Track cursor proximity to the scroll button on the plot (bubbles from the button too,
500
+ * so moving onto the button doesn't count as leaving). */
501
+ private readonly onScrollProximityMove;
502
+ private readonly onScrollProximityLeave;
503
+ /** Show the button only when the latest bar is scrolled off the right edge AND the cursor is nearby. */
504
+ private updateScrollToRealtimeButton;
505
+ /** Glide the view back to the most recent bars, keeping the current zoom (barSpacing). */
506
+ private scrollToRealtime;
507
+ /** Ease rightOffset to `target` at constant zoom (see animTick's scroll glide);
508
+ * instant when pan animation is off. Shared by scroll-to-latest and panBy. */
509
+ private glideRightOffset;
510
+ /**
511
+ * Export the current chart as a PNG data URL by compositing the geometry (L0)
512
+ * + chrome (L1) + user-drawings (L1.5) canvases onto an offscreen canvas. The
513
+ * background is filled first (the canvas2d data layer is transparent — its bg
514
+ * lives on the wrapper), and a fresh synchronous paint runs first so the WebGL2
515
+ * backend's (non-preserved) drawing buffer is populated before it's read back
516
+ * this tick — the same paint also repaints the drawings layers, so they're
517
+ * current (interleaved drawings are already inside the data composite). They're
518
+ * drawn bottom-up in DOM stacking order so the front user drawings (trend lines,
519
+ * boxes, etc.) sit above the Pine drawings on the chrome layer, matching what's
520
+ * on screen. The crosshair (L2) and DOM overlays (tables, legend) are
521
+ * intentionally excluded.
522
+ */
523
+ screenshot(): string | null;
524
+ /**
525
+ * The candles-first-appear reveal — animates the **candles themselves** (no extra
526
+ * element). Each candle's OHLC is interpolated from a flat tick at its open up to
527
+ * full size, eased, with a left→right stagger so the chart draws itself; `settle`
528
+ * adds an ease-out-back overshoot. Autoscale stays on the real bars so the frame
529
+ * never moves. Re-callable, so styles can be compared live from the console.
530
+ */
531
+ private playIntro;
532
+ /** After the candle reveal, fade the indicator models (series/fills/…) from hidden to full. */
533
+ private fadeInModels;
534
+ /**
535
+ * One candle of the reveal: interpolate its body + wick from a flat tick at the open
536
+ * up to full size, staggered left→right. `settle` overshoots past full then eases back.
537
+ */
538
+ private revealCandle;
539
+ /** Theme with the configured candle up/down colors applied (candles, wicks,
540
+ * plotcandle defaults, and the current-price line direction all follow them). */
541
+ private deriveTheme;
542
+ /** The theme the chrome (drawing toolbar / settings popups) paints with: the live theme
543
+ * but pinned to the stable surface background, text, and border, so custom plot cosmetics
544
+ * never recolor the toolbar, gutters, or drawing UI chrome. */
545
+ private chromeTheme;
546
+ mount(container: HTMLElement, theme: VelaTheme): void;
547
+ /**
548
+ * Create + mount the L0 geometry backend and return its canvas. Picks WebGL2
549
+ * when allowed + available (probed), else the canvas2d backend (the permanent
550
+ * fallback). If a GL context can't be acquired the (tainted) canvas is discarded
551
+ * and a fresh one is made for canvas2d.
552
+ */
553
+ private makeDataCanvas;
554
+ private createGeometryBackend;
555
+ /**
556
+ * The WebGL2 context became permanently unusable (a restore couldn't rebuild
557
+ * the program) → replace the L0 backend with the canvas2d fallback on a fresh
558
+ * data canvas. The chrome/cursor layers + viewport state are untouched.
559
+ */
560
+ private swapToCanvas2dFallback;
561
+ /**
562
+ * Re-sync both canvases when devicePixelRatio changes WITHOUT a CSS resize —
563
+ * e.g. dragging the window to a monitor with different scaling, or an OS/
564
+ * browser zoom change (the ResizeObserver doesn't fire for those). A
565
+ * `(resolution: Xdppx)` query only tracks one dpr boundary, so it's re-armed
566
+ * for the new dpr each time it fires.
567
+ */
568
+ private watchDpr;
569
+ private readonly onDprChange;
570
+ setTheme(theme: VelaTheme): void;
571
+ resize(): void;
572
+ /** Run a 1 Hz repaint pump while the countdown chip is on (so it ticks); stop it otherwise.
573
+ * Chrome tier: only the chip's wall-clock text moves — an idle chart must not recompute
574
+ * scales or repaint the geometry/volume/VPVR/SDK layers once a second (that cost
575
+ * multiplies by the cell count in a multi-chart workspace). */
576
+ private syncCountdownTimer;
577
+ destroy(): void;
578
+ setBars(bars: OHLCV[], opts?: {
579
+ preserveView?: boolean;
580
+ }): void;
581
+ updateBar(bar: OHLCV): void;
582
+ /** Snap the eased forming-bar state to `bar` — no glide (a fresh bar or the first tick of one). */
583
+ private syncLiveEase;
584
+ /** Glide the forming bar's displayed high/low/close toward the actual latest. Returns true while easing. */
585
+ private easeLiveBar;
586
+ ensurePane(pane: Pane): void;
587
+ removePane(id: string): void;
588
+ /** Move/merge a mounted indicator to another pane (its scale column follows via `ownScale`). */
589
+ setIndicatorPane(handle: IndicatorRenderHandle, paneId: string, opts?: {
590
+ ownScale?: boolean;
591
+ }): void;
592
+ orderPanes(orderedIds: string[]): void;
593
+ setPaneCollapsed(paneId: string, collapsed: boolean): void;
594
+ setPaneMaximized(paneId: string | null): void;
595
+ onPaneAction(cb: (a: PaneAction) => void): Unsubscribe;
596
+ private emitPaneAction;
597
+ onMoveIndicator(cb: (id: string, target: MoveTarget) => void): Unsubscribe;
598
+ /** The number of merged (own-scale) scale columns needed = max across panes. */
599
+ private maxOwnScaleColumns;
600
+ /** Recompute the right-gutter width (master column + one per merged scale). Re-sizes on change. */
601
+ private refreshAxisWidth;
602
+ /**
603
+ * Re-derive one model's index offset: the chart bar index of its `anchorTime` (see
604
+ * `IndicatorModel.anchorTime`). Absent anchor, or an anchor matching the first bar,
605
+ * means whole-chart alignment — offset 0, today's norm. An anchor that doesn't land
606
+ * exactly on a chart bar renders unanchored (defensive; engines stamp a real bar time).
607
+ */
608
+ private refreshAnchorOffset;
609
+ mountIndicator(model: IndicatorModel): IndicatorRenderHandle;
610
+ updateIndicator(handle: IndicatorRenderHandle, patch: ScenePatch): void;
611
+ removeIndicator(handle: IndicatorRenderHandle): void;
612
+ setIndicatorInputs(handle: IndicatorRenderHandle, values: Record<string, InputValue>): void;
613
+ setSymbolPicker(picker: SymbolPickerFn | null): void;
614
+ setLegendActions(provider: ((indicatorId: string) => LegendActionView[]) | null): void;
615
+ /**
616
+ * Hide/show a mounted indicator. Hiding drops its model from the scene (so every paint path —
617
+ * series, fills, drawings, tables, glow, data window — skips it) while keeping its z key and its
618
+ * legend row (marked hidden). The core re-mounts it on show, so this only needs to drop the
619
+ * visuals and flag the row.
620
+ */
621
+ setIndicatorVisible(handle: IndicatorRenderHandle, visible: boolean): void;
622
+ onInputChange(cb: (e: InputChangeEvent) => void): Unsubscribe;
623
+ onToggleIndicatorVisible(cb: (id: string, visible: boolean) => void): Unsubscribe;
624
+ onPriceStyleChange(cb: (style: PriceStyle) => void): Unsubscribe;
625
+ /**
626
+ * THE single write path for the base price style at runtime (feature set / settings dialog /
627
+ * config template — the constructor seeds the field directly, pre-listeners). Updates the
628
+ * scene, eases any reveal layer toward the new style's target, and notifies the core —
629
+ * which owns the DATA side of styles that need one (a chart type's SeriesDataEngine).
630
+ */
631
+ private setPriceStyle;
632
+ onRemoveIndicator(cb: (id: string) => void): Unsubscribe;
633
+ setSettingsSections(sections: HostSettingsSection[]): void;
634
+ onChartTypeSettingsChange(cb: (typeId: string, values: Record<string, unknown>) => void): Unsubscribe;
635
+ onConfigChanged(cb: () => void): Unsubscribe;
636
+ onThemeSelect(cb: (theme: ThemeName) => void): Unsubscribe;
637
+ onCrosshairMove(cb: (e: CrosshairEvent) => void): Unsubscribe;
638
+ onClick(cb: (e: ClickEvent) => void): Unsubscribe;
639
+ onViewportChange(cb: (range: VisibleRange) => void): Unsubscribe;
640
+ getVisibleRange(): VisibleRange | null;
641
+ setVisibleRange(range: VisibleRange): void;
642
+ /** Pan by a fraction of the visible width at constant zoom (positive ⇒ toward the
643
+ * latest bars). Mirrors a drag exactly: the target is clamped by the same viewport
644
+ * bounds (so panning forward stops at the newest candle plus the bounded right
645
+ * whitespace) and eases on the scroll-to-latest glide — repeated calls retarget the
646
+ * running glide, so a held key reads as one continuous scroll. */
647
+ panBy(fraction: number): void;
648
+ /** Instant viewport set (drag, freeze-on-touch, setVisibleRange) — stops any animation. */
649
+ private applyViewport;
650
+ /** Eased cursor-anchored zoom: glide barSpacing → target, pinning the anchor logical at its pixel. */
651
+ private zoomTo;
652
+ /** Inertial pan: continue with a rightOffset velocity (logical units / ms) that decays. */
653
+ private fling;
654
+ private anchoredRightOffset;
655
+ /**
656
+ * Bound the viewport so the user can't zoom/pan into a useless state:
657
+ * - zoom OUT no further than "all bars + a small margin fill the width" (no thin strip
658
+ * of compressed candles floating in whitespace);
659
+ * - zoom IN no further than keeping ≥ {@link MIN_VISIBLE_BARS} candles on screen;
660
+ * - pan no further than a bounded right whitespace / the same minimum visible.
661
+ * Applied at every viewport write (drag, wheel, fling, time-axis drag, keyboard).
662
+ */
663
+ private clampViewport;
664
+ /** One animation frame: ease zoom + integrate inertia + glide autoscale, then paint. */
665
+ private animTick;
666
+ /** Ease each pane's rendered scale toward its autoscale target (snap within epsilon).
667
+ * Log panes ease in LOG space so the glide is uniform on screen (the pane renders
668
+ * through Math.log), not a non-linear jump. */
669
+ private easeScales;
670
+ private emitViewportChange;
671
+ private handlePointerMove;
672
+ private handleClick;
673
+ private paneAtY;
674
+ /** The pane node whose vertical bounds contain `y` (linear scan; panes don't overlap). */
675
+ private paneNodeAtY;
676
+ /** The scale window a gesture targets: a pane's master scale, or a merged indicator's
677
+ * own scale column (resolved from the grabbed x). Both share the four scale fields. */
678
+ private resolveScaleHolder;
679
+ /** Grab the price axis: snapshot the grabbed scale's window and freeze it into manual mode. */
680
+ private beginPriceScale;
681
+ /** Rescale the grabbed scale around its center by the total drag (down ⇒ zoom out). */
682
+ private priceScaleBy;
683
+ /** Grab inside the data area: vertical price-pan is available only when the pane is
684
+ * already manual (so a normal drag stays a pure time-pan until the user opts in). */
685
+ private beginPricePan;
686
+ /** Pan the grabbed pane's price window by the total drag (down ⇒ show lower prices). */
687
+ private pricePanBy;
688
+ /** Double-click the price axis → drop manual mode for that scale (autoscale resumes). */
689
+ private resetPriceScale;
690
+ /**
691
+ * New double-click semantics inside the data area: the price pane toggles collapse of
692
+ * every study pane (hide/show sub panes); a study pane toggles maximize. (Keyboard `0`
693
+ * still fits the view.)
694
+ */
695
+ private dataDblClick;
696
+ /** Re-fit the view and drop every manual scale (keyboard `0`). */
697
+ private resetView;
698
+ private setManualScale;
699
+ /** Relayout + repaint + refresh the hover buttons after a collapse/maximize/order change. */
700
+ private afterPaneLayoutChange;
701
+ /** Thin projection of the panes for the hover-control cluster (top-to-bottom order). */
702
+ private paneControlViews;
703
+ /** Reorder a study pane one slot up/down (renderer-applied, mirrored to core via onPaneAction). */
704
+ private movePaneLocal;
705
+ /** True when `y` is within the hit zone of a draggable sub-pane separator. */
706
+ private paneSeparatorAt;
707
+ /** Pixel y of the draggable separator under the cursor (for the hover highlight), or null. */
708
+ private separatorHoverY;
709
+ /** Index (in `orderedPanes`) of the LOWER pane whose top separator is within the hit
710
+ * zone of `y`, or null. Separators sit between every adjacent pair, so the first
711
+ * candidate is index 1 (the top of the second pane). */
712
+ private separatorPaneIndexAt;
713
+ /** Grab the separator at `y`: snapshot the adjacent panes + their shared pixel span. */
714
+ private beginPaneResize;
715
+ /** Resize the grabbed panes by the total drag (down ⇒ grow the upper pane), keeping the
716
+ * combined weight fixed so every other pane keeps its height. */
717
+ private paneResizeBy;
718
+ /** Double-click a separator → split the two adjacent panes evenly (each gets half of
719
+ * their combined weight). A simple, predictable reset that leaves siblings untouched. */
720
+ private resetPaneSize;
721
+ /** Enable/disable keyboard control: focusability + ARIA + key listeners + live region. */
722
+ private setKeyboardEnabled;
723
+ /** Pan the view by a whole number of bars (keyboard): +bars ⇒ toward the latest. */
724
+ private panByBars;
725
+ /** Zoom one keyboard notch, right-edge anchored (+1 in, -1 out). */
726
+ private zoomByStep;
727
+ /** Move the focused bar by `delta` from the current crosshair bar (or the last bar). */
728
+ private stepCrosshair;
729
+ /** Center-ish the given bar in view (scrolling minimally), draw the crosshair on it,
730
+ * and announce its OHLC + indicator values to the ARIA live region. */
731
+ private focusBar;
732
+ /** Update the ARIA live region with a spoken summary of bar `idx` (date + OHLC + values). */
733
+ private announceBar;
734
+ /** The data-window readout (port seam) — the hovered bar's date/time and OHLCV plus every
735
+ * indicator's value there, or the latest bar when the cursor is off the plot. Values are
736
+ * pre-formatted on the scale of the pane they belong to, so a host panel renders them as-is. */
737
+ getDataWindowReadout(): DataWindowReadout;
738
+ private dataWindowPricePane;
739
+ private dataWindowFmt;
740
+ private dataWindowOHLC;
741
+ /** One group per indicator (name = indicator title), each with a row per drawable plot. */
742
+ private dataWindowGroups;
743
+ private renderFrame;
744
+ /** Paint the below-data (L-1) + geometry (L0) + chrome (L1) layers from the current scene/coords. */
745
+ private paintData;
746
+ /** Build the data→pixel projector user drawings resolve their anchors through. */
747
+ private drawingProjector;
748
+ /** OHLC bars whose open-time falls within `[from, to]` (inclusive) — the data a regression
749
+ * (or other statistical) drawing fits against. `this.bars` is ascending, so a linear scan is fine. */
750
+ private barsInTimeRange;
751
+ /** The interactive user-drawings surface the core DrawingController drives. */
752
+ get userDrawingsPort(): IDrawingsRendererPort | undefined;
753
+ /** Focus the data canvas — the element chart/drawing keyboard shortcuts key off
754
+ * (tabIndex 0 while the `keyboard` feature is on). Host UIs call it after their
755
+ * own controls steal focus (e.g. a shared workspace toolbar click). */
756
+ focus(): void;
757
+ /** EXTERNAL (synced) crosshair — a ghost marker driven by another chart. Kept in
758
+ * DATA space (epoch-ms + optional price) so it stays glued through pan/zoom. */
759
+ private externalCross;
760
+ /** Show/clear the external ghost crosshair (port seam — see IChartRenderer). It only
761
+ * repaints the cursor overlay (Cursor tier) and NEVER re-emits onCrosshairMove. */
762
+ setExternalCrosshair(time: Millis | null, price?: number | null): void;
763
+ /** Resolve the ghost to pixels for THIS frame (null when off-window or dataless).
764
+ * Snaps by FLOOR to the bar CONTAINING the foreign time — never by rounding: a 1h
765
+ * pointer at 14:00 must light THIS day's daily candle, not tomorrow's (a time past
766
+ * a bar's midpoint still belongs to that bar). Before the first open or past the
767
+ * forming bar there is no containing bar — no ghost. */
768
+ private externalCrossPx;
769
+ /** Sticky magnet mode for user drawings (off/weak/strong); the drawings toolbar drives it. */
770
+ private snapMode;
771
+ /** Set the sticky magnet mode (called by the drawings toolbar's 3-state button). */
772
+ setSnapMode(mode: SnapMode): void;
773
+ /**
774
+ * Snap a data point to the nearest candle for the drawing magnet: time → the nearest
775
+ * bar, price → that bar's closest OHLC value. Off the price pane (sub-panes have no
776
+ * OHLC) only the time snaps. `weak` only snaps when the candle point is within
777
+ * {@link WEAK_SNAP_PX} of the cursor pixel; `strong` always snaps; `off` is a no-op.
778
+ */
779
+ private snapToCandle;
780
+ /**
781
+ * Per-pane autoscale — the single price-window pass both layers consume. Folds
782
+ * the visible series (computePaneScale) with the visible Pine-drawing range
783
+ * (own drawings per pane + force_overlay drawings on the price pane), so a box/
784
+ * line/label outside the series range still expands the scale and never clips.
785
+ * Runs only on Light/Full frames (the crosshair-only Cursor tier reuses the
786
+ * retained pane.scale).
787
+ */
788
+ private computeScales;
789
+ /** Union of the visible trade-marker autoscale hints across every mounted indicator
790
+ * (trade markers always target the price pane, whatever pane their model landed on). */
791
+ private tradesScaleHints;
792
+ private fitContent;
793
+ private paneBoundsFor;
794
+ /** The display title of a study pane's master (pane-scale) indicator — merged own-scale
795
+ * indicators don't name the pane. Null when the pane holds no indicators. */
796
+ private paneMasterTitle;
797
+ /** The pane a bespoke-layer native indicator (volume/vpvr) currently lives in (null = not mounted). */
798
+ private nativeLayerPane;
799
+ /** True when an active volume layer is this study pane's ONLY content — so its scale should
800
+ * come from volume, not the empty {0,1} placeholder. (In the price pane, or alongside a real
801
+ * series, volume stays a bottom overlay and the master scale wins.) */
802
+ private volumeOwnsPane;
803
+ /** Per-pane scale state for a host UI (e.g. a price-axis context menu): the pane's pixel
804
+ * band (`top`/`height`, so a click y maps to a pane) plus its current axis `mode`/`log`.
805
+ * Top-to-bottom order. Every pane is independent — the price pane from the scene setting,
806
+ * study panes from their own. */
807
+ private paneScaleInfos;
808
+ /** Set one pane's axis mode. The price pane routes to the scene-level setting (persisted +
809
+ * keyboard shortcuts); a study pane keeps its own, so panes never affect each other. */
810
+ private setPaneScaleMode;
811
+ /** Set one pane's logarithmic flag. Clears that pane's frozen (manual) window so the new
812
+ * space re-fits, and routes the price pane to the scene-level flag. */
813
+ private setPaneLog;
814
+ /** Flip one pane's axis (high at the bottom). The price pane routes to the scene-level flag
815
+ * (persisted with the chart config); study panes keep their own so panes stay independent. */
816
+ private setPaneInvert;
817
+ /** Stamp each pane's current inversion onto the live scale objects that {@link CoordinateSystem}
818
+ * reads (the pane master scale, its target/manual windows, and any merged own-scale columns),
819
+ * so `priceToY`/`yToPrice` flip consistently across every layer — data, chrome, drawings,
820
+ * crosshair, hit-testing. Run once per paint (scales are rebuilt each frame by autoscale/ease),
821
+ * which also covers pointer-time reads between frames since the objects retain the last stamp. */
822
+ private stampScaleInvert;
823
+ /** The first visible value a study pane measures percent-change from: the earliest finite
824
+ * value at bar `i0` across its master series (line-like value, else a candle/bar close).
825
+ * 0 when none is available yet — the axis then falls back to absolute. */
826
+ private firstVisibleValue;
827
+ /** Largest volume across the visible bar-index window (0 when none) — the volume pane's scale top. */
828
+ private maxVisibleVolume;
829
+ /** Create/update/destroy an indicator's DOM table overlay (anchored off real pane geometry). */
830
+ private syncTables;
831
+ private repositionTables;
832
+ private layoutPanes;
833
+ /** Pin the scroll-to-realtime button above the bottom-most EXPANDED pane's data area (like the
834
+ * watermark): with all lower sub-panes collapsed it settles into the lowest open pane. */
835
+ private repositionScrollButton;
836
+ /** For each collapsed pane, the master (master-scale) indicator id whose legend row stays in the
837
+ * strip — merged own-scale indicators are hidden while collapsed. */
838
+ private collapsedMasterMap;
839
+ /** Reserve `px` of left gutter for the docked drawings toolbar (0 releases it) + re-lay-out the plot. */
840
+ private setToolbarGutter;
841
+ /** Publish the gutter on the mount container as `--vela-toolbar-gutter`, so host
842
+ * overlays sharing that container (a status line, a custom legend) can anchor to
843
+ * the plot's left edge without reaching into the renderer's DOM. */
844
+ private publishToolbarGutter;
845
+ /** The built-in mark, or the host's own when one is set. */
846
+ private buildAttributionEl;
847
+ /** Swap the mark in place — the content kind changed (built-in ↔ host-supplied). */
848
+ private rebuildAttribution;
849
+ /** Bottom-left of the LOWEST visible, non-collapsed pane, above the time axis, clear of
850
+ * the drawings toolbar — the same anchor rule as the scroll-to-realtime button. With
851
+ * collapsed strips (or a maximize hiding the rest) at the bottom, the mark climbs into
852
+ * the lowest open pane instead of sitting on a strip's legend. */
853
+ private positionAttribution;
854
+ /** Re-tint the mark when the plot background flips light/dark. A host-supplied mark
855
+ * only gets the ink color — its own artwork keeps whatever colors it declares. */
856
+ private refreshAttributionColor;
857
+ private syncSize;
858
+ private applyBackground;
859
+ }
860
+
861
+ /** Cosmetic/placement options — defaults reproduce the in-renderer docked bar exactly. */
862
+ interface DrawingToolbarOptions {
863
+ /** Border/divider color. Default: the theme's border color (follows theme swaps). */
864
+ borderColor?: string;
865
+ /** Bar width in px. In docked (`'absolute'`) use it MUST match the host renderer's
866
+ * left-gutter reservation ({@link TOOLBAR_WIDTH}, 44). Default 44. */
867
+ width?: number;
868
+ /** `'absolute'` (default): pinned over the renderer's left gutter. `'static'`: a
869
+ * normal column child — a workspace docks ONE shared bar in its own layout. */
870
+ dock?: 'absolute' | 'static';
871
+ /** Collapse/expand notification — a docked host resizes its gutter reservation to
872
+ * {@link TOOLBAR_COLLAPSED_WIDTH} / the full width (a static bar reflows on its own). */
873
+ onCollapse?: (collapsed: boolean) => void;
874
+ }
875
+ /**
876
+ * The vertical drawing toolbar (renderer chrome), docked as a flush bar in the left gutter. Each
877
+ * {@link ToolGroup} is a cell: clicking the icon arms the group's last-used tool; a chevron beside
878
+ * it — its own hover target, revealed on cell hover — opens a flyout listing the group's tools. A
879
+ * cursor button returns to select/idle; measure/eraser modes sit at the bottom, and the magnet is a
880
+ * cell whose chevron opens an Off/Weak/Strong menu (its icon toggles the last-used strength on/off).
881
+ * Below the magnet, a stay-in-drawing-mode toggle keeps tools armed after each placement.
882
+ * Hover and active tints are CSS-driven (`:hover` + `[data-active]`) so they never lag. Tooltips
883
+ * appear after a 2s hover. Pure vanilla DOM on the host (a `pointer-events:auto` island).
884
+ */
885
+ declare class DrawingToolbar {
886
+ private readonly host;
887
+ private theme;
888
+ private readonly onArm;
889
+ private readonly onMagnet;
890
+ private readonly onMeasure;
891
+ private readonly onEraser;
892
+ private readonly onToggleFavorite;
893
+ private readonly onStayMode;
894
+ private readonly root;
895
+ private def;
896
+ private active;
897
+ private readonly lastUsed;
898
+ /** FAVORITE tool types (core-authoritative; pushed via setFavorites). */
899
+ private favorites;
900
+ /** Per-tool shortcut display strings (host-pushed via setShortcuts). */
901
+ private shortcuts;
902
+ /** Star elements of the currently open flyout, by tool type (live-updated, never stale). */
903
+ private readonly starEls;
904
+ private flyout;
905
+ private flyoutOwnerId;
906
+ private flyoutCell;
907
+ private readonly groupCells;
908
+ private readonly groupIcons;
909
+ private cursorBtn;
910
+ private magnetCell;
911
+ private magnetIcon;
912
+ private magnetMode;
913
+ private lastMagnetOn;
914
+ private measureBtn;
915
+ private measureActive;
916
+ private eraserBtn;
917
+ private eraserActive;
918
+ private stayBtn;
919
+ private stayActive;
920
+ private collapseBtn;
921
+ private collapsed;
922
+ private visible;
923
+ private readonly tipText;
924
+ /** Chrome-tooltip disposers — flushed whenever the cells are recreated (rebuild/destroy). */
925
+ private tipDisposers;
926
+ /** Explicit border override from options; `null` follows the live theme's border. */
927
+ private readonly borderOverride;
928
+ private readonly width;
929
+ private readonly dock;
930
+ private readonly onCollapse;
931
+ constructor(host: HTMLElement, theme: VelaTheme, onArm: (type: DrawingTypeKey | null) => void, onMagnet?: (mode: SnapMode) => void, onMeasure?: () => void, onEraser?: () => void, onToggleFavorite?: (type: DrawingTypeKey, on: boolean) => void, onStayMode?: (on: boolean) => void, options?: DrawingToolbarOptions);
932
+ /** Live divider/border ink — the option override, else the current theme's border
933
+ * (so a theme swap re-inks the bar without a rebuild option). */
934
+ private get borderColor();
935
+ /** Flush vertical bar pinned to the left gutter (full height, right border, no card chrome).
936
+ * The shared tokens are written on the root so the scoped stylesheet drives every
937
+ * hover/active state without per-frame JS — and so a workspace can dock the bar outside a
938
+ * chart container and still resolve them. */
939
+ private styleRoot;
940
+ setDefinition(def: ToolbarDefinition): void;
941
+ /** Reflect the core's favorite set. An OPEN flyout updates its stars IN PLACE — starring
942
+ * is a side action, so it must never close the menu the user is still browsing. */
943
+ setFavorites(types: readonly DrawingTypeKey[]): void;
944
+ /** Per-tool shortcut hints (pre-formatted display strings, e.g. `'Alt+T'`) shown at the
945
+ * right edge of the flyout rows, beside the favorite star. */
946
+ setShortcuts(map: Readonly<Partial<Record<DrawingTypeKey, string>>>): void;
947
+ /** Paint one star for the current favorite state (filled + gold, or outline). */
948
+ private paintStar;
949
+ setVisible(visible: boolean): void;
950
+ setActiveTool(type: DrawingTypeKey | null): void;
951
+ setTheme(theme: VelaTheme): void;
952
+ destroy(): void;
953
+ private rebuild;
954
+ /** Collapse to a slim expand-strip / restore the full bar, and tell the host so a
955
+ * docked renderer can resize its gutter reservation. */
956
+ private toggleCollapsed;
957
+ private paintCollapse;
958
+ /** A cell: a full-width icon button (arms/toggles the primary action) plus, when
959
+ * {@link opts.multi} is set, a chevron button absolutely pinned to the right. The icon spans the
960
+ * whole cell so its glyph stays centered in the bar (aligned with the single-icon buttons); the
961
+ * hover/active tint lives on a centered square (`.vela-dtb-hit`) that hugs the glyph, not the whole
962
+ * row. The chevron is its own hover target — revealed on cell hover, tinted only on its own hover. */
963
+ private makeCell;
964
+ private makeGroupCell;
965
+ private makeMagnetCell;
966
+ /** Clicking the icon arms the group's last-used tool (it does NOT open the flyout). */
967
+ private onGroupIconClick;
968
+ /** Clicking the chevron toggles the group's flyout (same group → close; another → switch). */
969
+ private onArrowClick;
970
+ /** The magnet icon toggles the last-used strength on/off; the chevron opens the strength menu. */
971
+ private toggleMagnet;
972
+ private onMagnetArrowClick;
973
+ /** Set the magnet mode, notify the renderer, and repaint (used by the menu + icon toggle). */
974
+ private applyMagnet;
975
+ /** Reflect the magnet mode externally (e.g. if set programmatically) without notifying back. */
976
+ setMagnetMode(mode: SnapMode): void;
977
+ /** Highlight the Measure ruler button while the transient ruler is armed. */
978
+ setMeasureActive(active: boolean): void;
979
+ private paintMeasure;
980
+ /** Highlight the Eraser button while erase mode is active. */
981
+ setEraserActive(active: boolean): void;
982
+ private paintEraser;
983
+ private paintMagnet;
984
+ /** Toggle stay-in-drawing-mode on/off and notify the renderer. */
985
+ private toggleStay;
986
+ /** Reflect stay-in-drawing-mode externally without notifying back. */
987
+ setStayMode(on: boolean): void;
988
+ private paintStay;
989
+ /** Create the positioned flyout panel anchored to a cell, register it as open, and start the
990
+ * outside-dismiss. Callers fill it with items. */
991
+ private beginFlyout;
992
+ private openGroupFlyout;
993
+ private openMagnetFlyout;
994
+ private flyoutHeader;
995
+ private flyoutSeparator;
996
+ /** A flyout row, left to right: optional leading icon, label, a check when it's the selected
997
+ * entry, an optional shortcut hint, and — at the far right — the favorite star (tool rows).
998
+ * Hover tint is CSS (`.vela-dtb-item:hover`), so navigating the menu stays smooth. */
999
+ private makeFlyoutItem;
1000
+ private readonly onOutside;
1001
+ private closeFlyout;
1002
+ private paintGroupIcon;
1003
+ /** Reconcile active tints from state (armed group / open flyout / cursor / modes). Active is a
1004
+ * `data-active` attribute the stylesheet paints — no inline background, so hover never sticks. */
1005
+ private highlight;
1006
+ private makeButton;
1007
+ private divider;
1008
+ }
1009
+
1010
+ /**
1011
+ * In-memory cache of CLOSED bars, keyed by `(provider, symbol, timeframe)`. Each
1012
+ * series holds a single time-sorted, de-duplicated array. Scoped to the current
1013
+ * symbol — `retainSymbol` evicts other symbols' series (the agreed purge policy;
1014
+ * smarter eviction comes later) — except symbols protected via `retain`, the
1015
+ * multi-chart seam: a workspace declares every cell's symbol so one cell's load
1016
+ * never evicts the others' history.
1017
+ *
1018
+ * The default instance (`sharedBarStore`) is shared module-wide so it survives
1019
+ * chart re-creation — that's the whole point: a fresh run for the same symbol
1020
+ * reuses these bars instead of re-downloading them.
1021
+ */
1022
+ declare class BarStore {
1023
+ private readonly series;
1024
+ /** Earliest bar-open time fetched for a series — what the cache actually covers. */
1025
+ private readonly coveredFrom;
1026
+ private currentSymbol?;
1027
+ /** Symbols protected from the current-symbol purge (multi-chart cells). Empty = legacy single-chart behavior. */
1028
+ private retained;
1029
+ get(key: string): OHLCV[] | undefined;
1030
+ /**
1031
+ * Record that the series is covered back to `from`. Tracks the EARLIEST such
1032
+ * time — what's been fetched, not what bar boundary happens to align. The
1033
+ * coverage check uses this instead of the first cached bar's time (which is
1034
+ * always at/after the requested `from`, so it can never prove coverage).
1035
+ */
1036
+ markCovered(key: string, from: number): void;
1037
+ /** The earliest time the series is covered back to, or undefined if never fetched. */
1038
+ coveredFromOf(key: string): number | undefined;
1039
+ /** Merge `bars` into the series (dedup by time, incoming wins); keeps it sorted. Returns the merged set. */
1040
+ merge(key: string, bars: OHLCV[]): OHLCV[];
1041
+ /**
1042
+ * Scope the cache to the current chart symbol. Idempotent per symbol: only
1043
+ * purges other-symbol series when the symbol actually CHANGES — so secondary
1044
+ * series (request.security cross-symbol/HTF/LTF) fetched during a run survive
1045
+ * re-runs of the same chart, and are dropped only when the chart symbol flips.
1046
+ * Symbols declared via {@link retain} are never purged.
1047
+ */
1048
+ retainSymbol(symbol: string): void;
1049
+ /**
1050
+ * Declare the set of symbols a multi-chart workspace is displaying (CANONICAL
1051
+ * tickers, post-registry resolution — `chart.data.resolve(sym).ticker`). These
1052
+ * survive every {@link retainSymbol} purge, so cells loading different symbols
1053
+ * stop evicting each other's history. Replaces the previous set and purges
1054
+ * anything now outside `symbols ∪ {currentSymbol}` immediately. An empty set
1055
+ * restores the legacy single-chart policy. Note: SECONDARY symbols a script
1056
+ * fetches (`request.security` cross-symbol) are not in this set and still drop
1057
+ * on cross-cell loads — correctness is unaffected (they re-fetch on demand).
1058
+ */
1059
+ retain(symbols: ReadonlySet<string>): void;
1060
+ /** Drop every series whose symbol is neither `current` nor retained. */
1061
+ private purgeOutside;
1062
+ clear(): void;
1063
+ }
1064
+ /** Shared module-level store — survives chart re-creation so re-runs reuse bars. */
1065
+ declare const sharedBarStore: BarStore;
1066
+
1067
+ /**
1068
+ * The default `MarketDataFeed`: a router over a registry of named `DataProvider`s.
1069
+ * It parses every symbol (`name:SYMBOL` / bare `SYMBOL`), resolves a provider,
1070
+ * rewrites the config to that provider's **canonical** identity, and delegates to
1071
+ * an internal {@link CachingDataFeed} — so `BTCUSDT` and `BINANCE:BTCUSDT` collapse
1072
+ * to one cache entry. Offline `data` bypasses the registry entirely.
1073
+ *
1074
+ * Providers are registered at runtime via `chart.data.registerProvider(...)`. Until
1075
+ * one that resolves the chart symbol is registered, `load` **parks** (its promise
1076
+ * stays pending) rather than fetching — so registration drives the first load.
1077
+ */
1078
+ declare class MultiProviderFeed implements MarketDataFeed {
1079
+ private readonly registry;
1080
+ private readonly cache;
1081
+ /** The chart symbol's resolved provider — the default for bare secondary symbols. */
1082
+ private primaryProvider;
1083
+ /** A copy of offline history, used to synthesize ticks for the `data` path. */
1084
+ private liveBars;
1085
+ /** Sync-accessible symbol metadata, warmed by load()/symbolInfoFor (the engine reads it synchronously). */
1086
+ private readonly symInfoCache;
1087
+ constructor(store?: BarStore);
1088
+ registerProvider(name: string, provider: DataProvider): Promise<void>;
1089
+ unregisterProvider(name: string): void;
1090
+ providers(): ProviderInfo[];
1091
+ resolveSymbol(raw: string): Resolved | null;
1092
+ /** The registered provider INSTANCE under `name` (undefined if unknown). */
1093
+ providerInstance(name: string): DataProvider | undefined;
1094
+ symbols(name?: string): SymbolDescriptor[];
1095
+ /** Told when a symbol stays unservable by everything registered (the load is parked). */
1096
+ onUnresolved(cb: (info: {
1097
+ symbol: string;
1098
+ providers: string[];
1099
+ }) => void): Unsubscribe;
1100
+ /** Abandon parked waits — a destroyed chart must not keep listeners on the registry. */
1101
+ destroy(): void;
1102
+ /** Resolves when every registered provider's eager index has settled. */
1103
+ ready(): Promise<void>;
1104
+ /** Async per-symbol metadata (the facade's `chart.data.symbolInfo`); also warms the sync cache. */
1105
+ symbolInfoFor(raw: string): Promise<SymbolInfo | undefined>;
1106
+ /**
1107
+ * Per-symbol capabilities, resolved through the owning provider's `capabilitiesFor`
1108
+ * refinement (an instrument may support more than its provider-wide baseline), falling back to the
1109
+ * provider-wide `info()` capabilities. Null when nothing resolves the symbol.
1110
+ */
1111
+ capabilitiesFor(raw: string): ProviderCapabilities | null;
1112
+ load(cfg: MarketConfig): Promise<OHLCV[]>;
1113
+ /**
1114
+ * Synchronous per-symbol metadata for engines (Pine `syminfo.*`), served from the cache
1115
+ * warmed by load(). Undefined until the prefetch lands (the engine then synthesizes a
1116
+ * fallback) and real thereafter — the MarketDataFeed port is synchronous by contract.
1117
+ */
1118
+ symbolInfo(cfg: MarketConfig): SymbolInfo | undefined;
1119
+ private prefetchSymbolInfo;
1120
+ loadRange(cfg: MarketConfig, range: BarRange): Promise<OHLCV[]>;
1121
+ subscribe(cfg: MarketConfig, onBar: (bar: OHLCV) => void): Unsubscribe;
1122
+ /**
1123
+ * Synthesize price-relative ticks for offline `data` runs (no network), so the
1124
+ * forming-candle path is exercised at any price scale. Mirrors the bundled
1125
+ * provider feed's offline behavior.
1126
+ */
1127
+ private synthesizeTicks;
1128
+ }
1129
+
1130
+ /**
1131
+ * A `MarketDataFeed` decorator that caches CLOSED bars in a shared in-memory
1132
+ * `BarStore`. A new indicator run for the same `(provider, symbol, timeframe)`
1133
+ * serves the already-fetched bars and re-downloads only the uncached **tail**
1134
+ * (newly-closed bars + the forming candle). The forming bar is never cached — the
1135
+ * live poll re-fetches it.
1136
+ *
1137
+ * Savings on a re-run ≈ ⌈N/1000⌉ − 1 requests: dormant for ≤1000-bar charts (the
1138
+ * single tail request is the whole fetch either way), paying off with deep
1139
+ * history. Needs the inner feed's `loadRange`; without it — or for offline
1140
+ * `data` — it transparently falls back to a full `load`.
1141
+ */
1142
+ declare class CachingDataFeed implements MarketDataFeed {
1143
+ private readonly inner;
1144
+ private readonly store;
1145
+ constructor(inner: MarketDataFeed, store?: BarStore);
1146
+ load(cfg: MarketConfig): Promise<OHLCV[]>;
1147
+ /**
1148
+ * Cache-backed ranged fetch — the gateway engines use for secondary series
1149
+ * (`request.security` HTF/LTF/cross-symbol) and the orchestrator's backward
1150
+ * history chunks. Caches per `(provider, symbol, timeframe)` in the shared
1151
+ * store. Three cache-friendly shapes:
1152
+ * - **historical** (`to` before the cached tip): served straight from cache
1153
+ * when it provably holds the window, else fetched whole (and cached — no
1154
+ * forming bar can exist there);
1155
+ * - **backward extension** (`from` older than coverage): fetch ONLY the
1156
+ * missing head, never the already-covered remainder again;
1157
+ * - **tail** (everything else covered): refresh only from the last cached bar.
1158
+ * Falls back to a full `load` when the inner feed has no ranged support.
1159
+ */
1160
+ loadRange(cfg: MarketConfig, range: BarRange): Promise<OHLCV[]>;
1161
+ /**
1162
+ * THE provider round-trip chokepoint for ranged fetches. Two jobs:
1163
+ * - Every request goes out with an **explicit `limit`** — some sources clip a
1164
+ * limit-less request to a small default window and tail-slice, silently
1165
+ * truncating wide date-bounded fetches (the `request.security` bug).
1166
+ * - A request bigger than one page walks **backward in bounded pages**, so a
1167
+ * multi-hundred-thousand-bar series arrives as digestible responses instead
1168
+ * of one giant clip-prone payload.
1169
+ * Returns ascending merged bars plus the oldest time the walk PROVED
1170
+ * (`coveredDownTo`) — honest coverage marking: a count-satisfied early stop
1171
+ * must never claim the requested `from`.
1172
+ */
1173
+ private fetchRange;
1174
+ subscribe(cfg: MarketConfig, onBar: (bar: OHLCV) => void): Unsubscribe;
1175
+ symbolInfo(cfg: MarketConfig): SymbolInfo | undefined;
1176
+ }
1177
+
1178
+ /**
1179
+ * Bar duration in ms for a Vela timeframe: a bare number is **minutes** (Pine
1180
+ * resolution — `60` = 1h, `240` = 4h), `D`/`W`/`M` are the named periods, and the
1181
+ * `15m`/`4h`/`1d`/`1w` aliases are also accepted. Falls back to 1h for anything unparsed.
1182
+ */
1183
+ declare function timeframeToMs(timeframe: string): number;
1184
+
1185
+ declare const DARK_THEME: VelaTheme;
1186
+ declare const LIGHT_THEME: VelaTheme;
1187
+ declare function resolveTheme(theme?: ThemeName | VelaTheme): VelaTheme;
1188
+
1189
+ export { BarRange, BarStore, CachingDataFeed, type ChartConfig, type ChartStyle, ClickEvent, CrosshairEvent, DARK_THEME, DataProvider, DataWindowReadout, Drawing, DrawingStore, DrawingToolbar, type DrawingToolbarOptions, DrawingTypeKey, DrawingsDocument, IChartRenderer, IDrawingsRendererPort, IndicatorModel, IndicatorRenderHandle, InputChangeEvent, InputValue, LIGHT_THEME, LineStyle, MarketConfig, MarketDataFeed, Millis, MultiProviderFeed, NativeRenderer, OHLCV, Pane, PriceStyle, ProviderCapabilities, ProviderInfo, RendererCapabilities, RendererDisplayOptions, Resolved, ScenePatch, SerializedDrawing, SnapMode, SymbolDescriptor, SymbolInfo, ThemeName, ToolbarDefinition, VelaTheme, VisibleRange, resolveTheme, sharedBarStore, timeframeToMs };