@luxalgo/vela 0.5.0 → 0.5.2
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.
- package/dist/{DataProvider-Dzd-Erlk.d.ts → DataProvider-DTOEXKTI.d.ts} +1 -1
- package/dist/{DataProvider-DKNDHpNv.d.cts → DataProvider-gnzv-dgc.d.cts} +1 -1
- package/dist/{chunk-KM6LHB3Y.js → chunk-ATPU5CI6.js} +6 -1
- package/dist/{chunk-7UFX5ZIG.js → chunk-B5TIKQJ5.js} +65 -7
- package/dist/{chunk-GYD2THPV.js → chunk-LJLZR44Y.js} +9 -2
- package/dist/{chunk-RHIDOUFL.js → chunk-P556H6EA.js} +329 -10
- package/dist/{chunk-KCCZNKH7.js → chunk-RRFGWZNJ.js} +1915 -367
- package/dist/{chunk-OVQKKXLZ.js → chunk-Y7TK4ZWK.js} +1810 -153
- package/dist/{contributions-o1GRKPI_.d.cts → contributions-Ci_i3IN2.d.cts} +77 -31
- package/dist/{contributions-hX3EUyjG.d.ts → contributions-b6AVrqqG.d.ts} +77 -31
- package/dist/{history-LJkz4-sS.d.cts → history-Cf1lVsap.d.cts} +22 -5
- package/dist/{history-Dzxz-MQj.d.ts → history-Ci3M0xLV.d.ts} +22 -5
- package/dist/index.cjs +2010 -397
- package/dist/index.d.cts +83 -25
- package/dist/index.d.ts +83 -25
- package/dist/index.js +4 -4
- package/dist/{options-Q-576hIi.d.cts → options-XTBpbx0s.d.cts} +61 -1
- package/dist/{options-Q-576hIi.d.ts → options-XTBpbx0s.d.ts} +61 -1
- package/dist/{plugin-aGUD1epn.d.ts → plugin-CnNd7cuF.d.ts} +305 -8
- package/dist/{plugin-D94muTV-.d.cts → plugin-DfH4Y-Om.d.cts} +305 -8
- package/dist/plugin.cjs +58 -7
- package/dist/plugin.d.cts +4 -4
- package/dist/plugin.d.ts +4 -4
- package/dist/plugin.js +2 -2
- package/dist/providers/binance.d.cts +2 -2
- package/dist/providers/binance.d.ts +2 -2
- package/dist/providers/coinbase.d.cts +2 -2
- package/dist/providers/coinbase.d.ts +2 -2
- package/dist/providers/hyperliquid.d.cts +2 -2
- package/dist/providers/hyperliquid.d.ts +2 -2
- package/dist/ui.cjs +342 -9
- package/dist/ui.d.cts +64 -2
- package/dist/ui.d.ts +64 -2
- package/dist/ui.js +3 -3
- package/dist/vela.global.js +2010 -397
- package/dist/vela.global.min.js +115 -34
- package/dist/widget.cjs +5987 -2242
- package/dist/widget.d.cts +89 -17
- package/dist/widget.d.ts +89 -17
- package/dist/widget.js +169 -18
- package/dist/workspace.cjs +5627 -1587
- package/dist/workspace.d.cts +106 -12
- package/dist/workspace.d.ts +106 -12
- package/dist/workspace.js +494 -52
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { s as Millis,
|
|
2
|
-
import { S as SymbolInfo, B as BarRange, M as MarketDataFeed, D as DataProvider, P as ProviderInfo, a as SymbolDescriptor, b as ProviderCapabilities } from './DataProvider-
|
|
1
|
+
import { s as Millis, ac as InputSchema, ab as IndicatorMeta, P as PriceStyle, O as OHLCV, l as InputValue, j as IndicatorModel, i as MoveTarget, ay as SeriesSpec, a9 as Fill, B as Background, aq as PriceLine, $ as DrawingLine, X as DrawingBox, _ as DrawingLabel, a3 as DrawingPolyline, a0 as DrawingLinefill, a5 as DrawingTable, f as IndicatorStatus, a as VisibleRange, c as VelaTheme, S as SerializedDrawing, u as DrawingTypeKey, t as SnapMode, a1 as DrawingMode, I as IChartRenderer, R as RendererCapabilities, n as LegendActionView, U as Unsubscribe, C as CrosshairEvent, A as AxisLongPressEvent, q as DataWindowReadout, m as SymbolPickerFn, aK as PaneInfo, a8 as DrawingsOption, D as Drawing, b as VelaOptions, w as AddIndicatorOptions, am as MarketSwitch, al as MarketSnapshot, V as VisibleRangePreset, T as ThemeName } from './options-XTBpbx0s.cjs';
|
|
2
|
+
import { S as SymbolInfo, B as BarRange, M as MarketDataFeed, D as DataProvider, P as ProviderInfo, a as SymbolDescriptor, b as ProviderCapabilities } from './DataProvider-gnzv-dgc.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* A strategy's broker state at ONE bar — the flat summary a host reads while a script
|
|
@@ -434,7 +434,13 @@ interface NativeIndicator {
|
|
|
434
434
|
*/
|
|
435
435
|
interface NativeIndicatorDescriptor {
|
|
436
436
|
readonly type: string;
|
|
437
|
+
/** Full display name (picker, settings header, handle title). */
|
|
437
438
|
readonly title: string;
|
|
439
|
+
/**
|
|
440
|
+
* Compact name for the on-chart legend chip. Absent ⇒ {@link title}. The picker and
|
|
441
|
+
* settings dialog keep the full title either way.
|
|
442
|
+
*/
|
|
443
|
+
readonly shortTitle?: string;
|
|
438
444
|
readonly paneHint: 'price' | 'new';
|
|
439
445
|
readonly overlay: boolean;
|
|
440
446
|
/** Whether instances react to viewport changes (drives the orchestrator's viewport poke). */
|
|
@@ -571,7 +577,7 @@ interface VelaEventMap extends Record<string, unknown> {
|
|
|
571
577
|
* previous identity so hosts can re-key per-symbol state (e.g. swap user-drawing
|
|
572
578
|
* documents between symbols).
|
|
573
579
|
*/
|
|
574
|
-
|
|
580
|
+
"market:changed": {
|
|
575
581
|
symbol: string;
|
|
576
582
|
timeframe: string;
|
|
577
583
|
prev: {
|
|
@@ -587,7 +593,7 @@ interface VelaEventMap extends Record<string, unknown> {
|
|
|
587
593
|
* their own visuals here. Exactly one `load:end` follows. A depth-only reload
|
|
588
594
|
* (`bars`) keeps the chart painted and fires neither.
|
|
589
595
|
*/
|
|
590
|
-
|
|
596
|
+
"load:start": {
|
|
591
597
|
symbol: string;
|
|
592
598
|
timeframe: string;
|
|
593
599
|
firstLoad: boolean;
|
|
@@ -598,39 +604,39 @@ interface VelaEventMap extends Record<string, unknown> {
|
|
|
598
604
|
* fetch, an empty market, or a parked symbol nothing serves). Counterpart of
|
|
599
605
|
* `load:start`; plugins restore or rebuild their visuals here.
|
|
600
606
|
*/
|
|
601
|
-
|
|
607
|
+
"load:end": {
|
|
602
608
|
symbol: string;
|
|
603
609
|
timeframe: string;
|
|
604
610
|
bars: number;
|
|
605
611
|
};
|
|
606
|
-
|
|
612
|
+
"indicator:added": {
|
|
607
613
|
id: string;
|
|
608
614
|
};
|
|
609
|
-
|
|
615
|
+
"indicator:removed": {
|
|
610
616
|
id: string;
|
|
611
617
|
};
|
|
612
|
-
|
|
618
|
+
"indicator:error": {
|
|
613
619
|
id: string;
|
|
614
620
|
error: Error;
|
|
615
621
|
};
|
|
616
622
|
/** No registered provider can serve the chart symbol — the load is PARKED, not failed:
|
|
617
623
|
* it resumes by itself if a capable provider registers later. */
|
|
618
|
-
|
|
624
|
+
"data:unresolved": {
|
|
619
625
|
symbol: string;
|
|
620
626
|
providers: string[];
|
|
621
627
|
};
|
|
622
628
|
/** An indicator was moved/merged to another pane (`chart.panes` / legend / object tree). */
|
|
623
|
-
|
|
629
|
+
"indicator:moved": {
|
|
624
630
|
id: string;
|
|
625
631
|
paneId: string;
|
|
626
632
|
};
|
|
627
633
|
/** An indicator was shown/hidden (legend eye, `handle.setVisible`, or object tree). */
|
|
628
|
-
|
|
634
|
+
"indicator:visibility": {
|
|
629
635
|
id: string;
|
|
630
636
|
visible: boolean;
|
|
631
637
|
};
|
|
632
638
|
/** A pane's layout changed: order, collapse/maximize, creation or removal. */
|
|
633
|
-
|
|
639
|
+
"pane:changed": undefined;
|
|
634
640
|
/**
|
|
635
641
|
* The app theme changed — `chart.setTheme(...)` or the in-chart settings dialog's
|
|
636
642
|
* Canvas → Theme row. Payload is the RESOLVED theme; host chrome around the chart
|
|
@@ -638,53 +644,60 @@ interface VelaEventMap extends Record<string, unknown> {
|
|
|
638
644
|
* cosmetic edits (`layout.background` through the config), which deliberately
|
|
639
645
|
* leave the app theme alone.
|
|
640
646
|
*/
|
|
641
|
-
|
|
647
|
+
"theme:changed": VelaTheme;
|
|
642
648
|
/** A study pane was reordered one slot (`dir`) — carries enough to invert for undo/redo. */
|
|
643
|
-
|
|
649
|
+
"pane:moved": {
|
|
644
650
|
paneId: string;
|
|
645
|
-
dir:
|
|
651
|
+
dir: "up" | "down";
|
|
646
652
|
};
|
|
647
653
|
/** A user drawing was created (interactively or via `chart.drawings.add`). */
|
|
648
|
-
|
|
654
|
+
"drawing:created": {
|
|
649
655
|
id: string;
|
|
650
656
|
};
|
|
657
|
+
/** An interactive placement is in progress — the ghost's current shape after each
|
|
658
|
+
* anchor click / cursor move, `null` when placement ends (finalized or
|
|
659
|
+
* cancelled). Transient: nothing is in the store yet. Multi-chart hosts mirror
|
|
660
|
+
* it on linked charts via `drawings.setExternalGhost`. */
|
|
661
|
+
"drawing:draft": {
|
|
662
|
+
doc: SerializedDrawing | null;
|
|
663
|
+
};
|
|
651
664
|
/** A user drawing's anchors/style/text changed. */
|
|
652
|
-
|
|
665
|
+
"drawing:edited": {
|
|
653
666
|
id: string;
|
|
654
667
|
};
|
|
655
668
|
/** Selection changed (`id` is null when nothing is selected). */
|
|
656
|
-
|
|
669
|
+
"drawing:selected": {
|
|
657
670
|
id: string | null;
|
|
658
671
|
};
|
|
659
672
|
/** The favorite-tool set changed (star toggles or a bulk restore). */
|
|
660
|
-
|
|
673
|
+
"drawing:favorites": {
|
|
661
674
|
favorites: string[];
|
|
662
675
|
};
|
|
663
676
|
/** The armed drawing tool changed — toolbar click, one-shot tool finishing (back to
|
|
664
677
|
* the pointer, `null`), or a programmatic `drawings.setTool`. */
|
|
665
|
-
|
|
678
|
+
"drawing:tool": {
|
|
666
679
|
type: DrawingTypeKey | null;
|
|
667
680
|
};
|
|
668
681
|
/** The magnet snap mode changed (in-chart toolbar or `drawings.setSnapMode`). */
|
|
669
|
-
|
|
682
|
+
"drawing:snap": {
|
|
670
683
|
mode: SnapMode;
|
|
671
684
|
};
|
|
672
685
|
/** Stay-in-drawing-mode changed (in-chart toolbar or `drawings.setStayMode`) — when
|
|
673
686
|
* on, finishing a drawing leaves the tool armed. */
|
|
674
|
-
|
|
687
|
+
"drawing:stay": {
|
|
675
688
|
on: boolean;
|
|
676
689
|
};
|
|
677
690
|
/** The renderer-local mode changed: measure ruler, eraser, or none — including the
|
|
678
691
|
* mutual-exclusion exits (arming a tool leaves measure/eraser). */
|
|
679
|
-
|
|
692
|
+
"drawing:mode": {
|
|
680
693
|
mode: DrawingMode;
|
|
681
694
|
};
|
|
682
695
|
/** A user drawing was removed. */
|
|
683
|
-
|
|
696
|
+
"drawing:removed": {
|
|
684
697
|
id: string;
|
|
685
698
|
};
|
|
686
699
|
/** The user requested a drawing's settings popup. */
|
|
687
|
-
|
|
700
|
+
"drawing:settings": {
|
|
688
701
|
id: string;
|
|
689
702
|
};
|
|
690
703
|
/**
|
|
@@ -695,11 +708,11 @@ interface VelaEventMap extends Record<string, unknown> {
|
|
|
695
708
|
* indicator while streaming, and only emitted for engines that expose an execution
|
|
696
709
|
* context. Native (core-computed) indicators never fire it — they run no script.
|
|
697
710
|
*/
|
|
698
|
-
|
|
711
|
+
"script:run": ScriptRun;
|
|
699
712
|
/** An indicator's execution context advanced (run finished, or throttled during
|
|
700
713
|
* streaming) — re-pull `handle.context()` if you consume it. Prefer `script:run`,
|
|
701
714
|
* which delivers the data rather than a signal to go fetch it. */
|
|
702
|
-
|
|
715
|
+
"context:changed": {
|
|
703
716
|
id: string;
|
|
704
717
|
};
|
|
705
718
|
/** A live tick: the forming bar was updated or a new bar appended. */
|
|
@@ -709,12 +722,12 @@ interface VelaEventMap extends Record<string, unknown> {
|
|
|
709
722
|
* debounced; the engine re-run debounce is separate). Payload = `{from, to}` in
|
|
710
723
|
* epoch-ms. The seam viewport-sync links between charts build on.
|
|
711
724
|
*/
|
|
712
|
-
|
|
725
|
+
"viewport:changed": {
|
|
713
726
|
from: number;
|
|
714
727
|
to: number;
|
|
715
728
|
};
|
|
716
729
|
/** A deep-history backfill chunk landed (`loaded` of `target` bars are on the chart). */
|
|
717
|
-
|
|
730
|
+
"history:progress": {
|
|
718
731
|
loaded: number;
|
|
719
732
|
target: number;
|
|
720
733
|
};
|
|
@@ -724,8 +737,8 @@ interface VelaEventMap extends Record<string, unknown> {
|
|
|
724
737
|
* the data was non-monotonic — the chart keeps what loaded. Fires exactly once, including
|
|
725
738
|
* for small/offline charts (immediately after their single load).
|
|
726
739
|
*/
|
|
727
|
-
|
|
728
|
-
reason:
|
|
740
|
+
"history:complete": {
|
|
741
|
+
reason: "depth" | "genesis" | "aborted";
|
|
729
742
|
oldestTime: number;
|
|
730
743
|
barsLoaded: number;
|
|
731
744
|
};
|
|
@@ -814,6 +827,20 @@ declare class RendererControl {
|
|
|
814
827
|
* degradation as the sync ghost crosshair.
|
|
815
828
|
*/
|
|
816
829
|
setLegendActions(provider: ((indicatorId: string) => LegendActionView[]) | null): void;
|
|
830
|
+
/**
|
|
831
|
+
* Replace the indicator legend's fold toggle with a host action (or restore it with
|
|
832
|
+
* `null`) — multi-chart shells point the chip at their indicator overview instead of
|
|
833
|
+
* unfolding rows in place. Silent no-op on a renderer without a foldable legend.
|
|
834
|
+
*/
|
|
835
|
+
setLegendOverviewAction(action: (() => void) | null): this;
|
|
836
|
+
/** Whether the active renderer can open a per-indicator settings dialog. */
|
|
837
|
+
get supportsIndicatorSettings(): boolean;
|
|
838
|
+
/**
|
|
839
|
+
* Open one indicator's settings dialog — the programmatic twin of the legend gear
|
|
840
|
+
* (see {@link supportsIndicatorSettings}). Silent no-op without the seam or for an
|
|
841
|
+
* unknown id.
|
|
842
|
+
*/
|
|
843
|
+
openIndicatorSettings(indicatorId: string): this;
|
|
817
844
|
/**
|
|
818
845
|
* Export the current chart as a PNG data URL, or null if the active renderer
|
|
819
846
|
* doesn't support it (warns). DOM overlays (tables, legend) are not included.
|
|
@@ -844,6 +871,8 @@ declare class RendererControl {
|
|
|
844
871
|
* public seam host chrome (status lines, data windows) builds on.
|
|
845
872
|
*/
|
|
846
873
|
onCrosshairMove(cb: (e: CrosshairEvent) => void): Unsubscribe;
|
|
874
|
+
/** Touch long-press on a price or time axis strip — silent no-op without the seam. */
|
|
875
|
+
onAxisLongPress(cb: (e: AxisLongPressEvent) => void): Unsubscribe;
|
|
847
876
|
/**
|
|
848
877
|
* The current data-window readout — the hovered bar's date/time and OHLCV plus every
|
|
849
878
|
* indicator's value there, each already formatted on its pane's scale (the latest bar when
|
|
@@ -889,6 +918,10 @@ declare class RendererControl {
|
|
|
889
918
|
title: string;
|
|
890
919
|
rows: readonly unknown[];
|
|
891
920
|
}>): this;
|
|
921
|
+
/** Tell the renderer's own chrome which size class the host shell is in —
|
|
922
|
+
* `'mobile'` switches its dialogs/toolbars to the touch-first presentation.
|
|
923
|
+
* Silent no-op on a renderer without adaptive chrome. */
|
|
924
|
+
setLayoutMode(mode: 'mobile' | 'desktop'): this;
|
|
892
925
|
}
|
|
893
926
|
|
|
894
927
|
/** Callback surface `PanesControl` uses to drive the orchestrator. */
|
|
@@ -1005,6 +1038,9 @@ declare class DrawingController {
|
|
|
1005
1038
|
setFavorites(types: readonly DrawingTypeKey[]): void;
|
|
1006
1039
|
private pushFavorites;
|
|
1007
1040
|
setToolbar(option: DrawingsOption): void;
|
|
1041
|
+
/** Display (or clear) another chart's in-progress placement as a ghost — silently
|
|
1042
|
+
* inert on a renderer without the optional `setExternalGhost` seam. */
|
|
1043
|
+
setExternalGhost(doc: SerializedDrawing | null): void;
|
|
1008
1044
|
/** Push per-tool shortcut hints (pre-formatted display strings) to the toolbar flyouts. */
|
|
1009
1045
|
setToolShortcuts(map: Readonly<Partial<Record<DrawingTypeKey, string>>>): void;
|
|
1010
1046
|
add(type: DrawingTypeKey, init?: AddInit): Drawing | null;
|
|
@@ -1108,6 +1144,11 @@ declare class DrawingsControl {
|
|
|
1108
1144
|
* display strings (e.g. `'Alt+T'`, `'⌥T'`) — the host owns the keymap and the
|
|
1109
1145
|
* platform formatting, so hints always match the host's actual bindings. */
|
|
1110
1146
|
setToolShortcuts(map: Readonly<Partial<Record<DrawingTypeKey, string>>>): this;
|
|
1147
|
+
/** Display another chart's in-progress placement as a GHOST at reduced opacity
|
|
1148
|
+
* (`null` clears it) — how a multi-chart host mirrors `drawing:draft` onto linked
|
|
1149
|
+
* charts. Never a real drawing: no store entry, no selection, no persistence.
|
|
1150
|
+
* Silently inert on a renderer without the optional seam. */
|
|
1151
|
+
setExternalGhost(doc: SerializedDrawing | null): this;
|
|
1111
1152
|
/** Create a drawing programmatically (no clicking). Returns it, or null if unsupported. */
|
|
1112
1153
|
add(type: DrawingTypeKey, init?: AddInit): Drawing | null;
|
|
1113
1154
|
remove(id: string): this;
|
|
@@ -1385,6 +1426,11 @@ interface WidgetActionDescriptor {
|
|
|
1385
1426
|
icon?: string;
|
|
1386
1427
|
/** Sort key within the contributed group (ascending; default 0). */
|
|
1387
1428
|
order?: number;
|
|
1429
|
+
/** Topbar only: which cluster the button joins. `'right'` (default) is the
|
|
1430
|
+
* right-hand tools cluster; `'left'` puts it with the PRIMARY chrome buttons —
|
|
1431
|
+
* right after the style/layout dropdowns, styled like them (the spot and look of
|
|
1432
|
+
* the built-in Indicators button, for actions that replace it). */
|
|
1433
|
+
align?: 'left' | 'right';
|
|
1388
1434
|
/** Runtime gate — omitted ⇒ always shown. */
|
|
1389
1435
|
when?: (ctx: WidgetContext) => boolean;
|
|
1390
1436
|
run: (ctx: WidgetContext) => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { s as Millis,
|
|
2
|
-
import { S as SymbolInfo, B as BarRange, M as MarketDataFeed, D as DataProvider, P as ProviderInfo, a as SymbolDescriptor, b as ProviderCapabilities } from './DataProvider-
|
|
1
|
+
import { s as Millis, ac as InputSchema, ab as IndicatorMeta, P as PriceStyle, O as OHLCV, l as InputValue, j as IndicatorModel, i as MoveTarget, ay as SeriesSpec, a9 as Fill, B as Background, aq as PriceLine, $ as DrawingLine, X as DrawingBox, _ as DrawingLabel, a3 as DrawingPolyline, a0 as DrawingLinefill, a5 as DrawingTable, f as IndicatorStatus, a as VisibleRange, c as VelaTheme, S as SerializedDrawing, u as DrawingTypeKey, t as SnapMode, a1 as DrawingMode, I as IChartRenderer, R as RendererCapabilities, n as LegendActionView, U as Unsubscribe, C as CrosshairEvent, A as AxisLongPressEvent, q as DataWindowReadout, m as SymbolPickerFn, aK as PaneInfo, a8 as DrawingsOption, D as Drawing, b as VelaOptions, w as AddIndicatorOptions, am as MarketSwitch, al as MarketSnapshot, V as VisibleRangePreset, T as ThemeName } from './options-XTBpbx0s.js';
|
|
2
|
+
import { S as SymbolInfo, B as BarRange, M as MarketDataFeed, D as DataProvider, P as ProviderInfo, a as SymbolDescriptor, b as ProviderCapabilities } from './DataProvider-DTOEXKTI.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* A strategy's broker state at ONE bar — the flat summary a host reads while a script
|
|
@@ -434,7 +434,13 @@ interface NativeIndicator {
|
|
|
434
434
|
*/
|
|
435
435
|
interface NativeIndicatorDescriptor {
|
|
436
436
|
readonly type: string;
|
|
437
|
+
/** Full display name (picker, settings header, handle title). */
|
|
437
438
|
readonly title: string;
|
|
439
|
+
/**
|
|
440
|
+
* Compact name for the on-chart legend chip. Absent ⇒ {@link title}. The picker and
|
|
441
|
+
* settings dialog keep the full title either way.
|
|
442
|
+
*/
|
|
443
|
+
readonly shortTitle?: string;
|
|
438
444
|
readonly paneHint: 'price' | 'new';
|
|
439
445
|
readonly overlay: boolean;
|
|
440
446
|
/** Whether instances react to viewport changes (drives the orchestrator's viewport poke). */
|
|
@@ -571,7 +577,7 @@ interface VelaEventMap extends Record<string, unknown> {
|
|
|
571
577
|
* previous identity so hosts can re-key per-symbol state (e.g. swap user-drawing
|
|
572
578
|
* documents between symbols).
|
|
573
579
|
*/
|
|
574
|
-
|
|
580
|
+
"market:changed": {
|
|
575
581
|
symbol: string;
|
|
576
582
|
timeframe: string;
|
|
577
583
|
prev: {
|
|
@@ -587,7 +593,7 @@ interface VelaEventMap extends Record<string, unknown> {
|
|
|
587
593
|
* their own visuals here. Exactly one `load:end` follows. A depth-only reload
|
|
588
594
|
* (`bars`) keeps the chart painted and fires neither.
|
|
589
595
|
*/
|
|
590
|
-
|
|
596
|
+
"load:start": {
|
|
591
597
|
symbol: string;
|
|
592
598
|
timeframe: string;
|
|
593
599
|
firstLoad: boolean;
|
|
@@ -598,39 +604,39 @@ interface VelaEventMap extends Record<string, unknown> {
|
|
|
598
604
|
* fetch, an empty market, or a parked symbol nothing serves). Counterpart of
|
|
599
605
|
* `load:start`; plugins restore or rebuild their visuals here.
|
|
600
606
|
*/
|
|
601
|
-
|
|
607
|
+
"load:end": {
|
|
602
608
|
symbol: string;
|
|
603
609
|
timeframe: string;
|
|
604
610
|
bars: number;
|
|
605
611
|
};
|
|
606
|
-
|
|
612
|
+
"indicator:added": {
|
|
607
613
|
id: string;
|
|
608
614
|
};
|
|
609
|
-
|
|
615
|
+
"indicator:removed": {
|
|
610
616
|
id: string;
|
|
611
617
|
};
|
|
612
|
-
|
|
618
|
+
"indicator:error": {
|
|
613
619
|
id: string;
|
|
614
620
|
error: Error;
|
|
615
621
|
};
|
|
616
622
|
/** No registered provider can serve the chart symbol — the load is PARKED, not failed:
|
|
617
623
|
* it resumes by itself if a capable provider registers later. */
|
|
618
|
-
|
|
624
|
+
"data:unresolved": {
|
|
619
625
|
symbol: string;
|
|
620
626
|
providers: string[];
|
|
621
627
|
};
|
|
622
628
|
/** An indicator was moved/merged to another pane (`chart.panes` / legend / object tree). */
|
|
623
|
-
|
|
629
|
+
"indicator:moved": {
|
|
624
630
|
id: string;
|
|
625
631
|
paneId: string;
|
|
626
632
|
};
|
|
627
633
|
/** An indicator was shown/hidden (legend eye, `handle.setVisible`, or object tree). */
|
|
628
|
-
|
|
634
|
+
"indicator:visibility": {
|
|
629
635
|
id: string;
|
|
630
636
|
visible: boolean;
|
|
631
637
|
};
|
|
632
638
|
/** A pane's layout changed: order, collapse/maximize, creation or removal. */
|
|
633
|
-
|
|
639
|
+
"pane:changed": undefined;
|
|
634
640
|
/**
|
|
635
641
|
* The app theme changed — `chart.setTheme(...)` or the in-chart settings dialog's
|
|
636
642
|
* Canvas → Theme row. Payload is the RESOLVED theme; host chrome around the chart
|
|
@@ -638,53 +644,60 @@ interface VelaEventMap extends Record<string, unknown> {
|
|
|
638
644
|
* cosmetic edits (`layout.background` through the config), which deliberately
|
|
639
645
|
* leave the app theme alone.
|
|
640
646
|
*/
|
|
641
|
-
|
|
647
|
+
"theme:changed": VelaTheme;
|
|
642
648
|
/** A study pane was reordered one slot (`dir`) — carries enough to invert for undo/redo. */
|
|
643
|
-
|
|
649
|
+
"pane:moved": {
|
|
644
650
|
paneId: string;
|
|
645
|
-
dir:
|
|
651
|
+
dir: "up" | "down";
|
|
646
652
|
};
|
|
647
653
|
/** A user drawing was created (interactively or via `chart.drawings.add`). */
|
|
648
|
-
|
|
654
|
+
"drawing:created": {
|
|
649
655
|
id: string;
|
|
650
656
|
};
|
|
657
|
+
/** An interactive placement is in progress — the ghost's current shape after each
|
|
658
|
+
* anchor click / cursor move, `null` when placement ends (finalized or
|
|
659
|
+
* cancelled). Transient: nothing is in the store yet. Multi-chart hosts mirror
|
|
660
|
+
* it on linked charts via `drawings.setExternalGhost`. */
|
|
661
|
+
"drawing:draft": {
|
|
662
|
+
doc: SerializedDrawing | null;
|
|
663
|
+
};
|
|
651
664
|
/** A user drawing's anchors/style/text changed. */
|
|
652
|
-
|
|
665
|
+
"drawing:edited": {
|
|
653
666
|
id: string;
|
|
654
667
|
};
|
|
655
668
|
/** Selection changed (`id` is null when nothing is selected). */
|
|
656
|
-
|
|
669
|
+
"drawing:selected": {
|
|
657
670
|
id: string | null;
|
|
658
671
|
};
|
|
659
672
|
/** The favorite-tool set changed (star toggles or a bulk restore). */
|
|
660
|
-
|
|
673
|
+
"drawing:favorites": {
|
|
661
674
|
favorites: string[];
|
|
662
675
|
};
|
|
663
676
|
/** The armed drawing tool changed — toolbar click, one-shot tool finishing (back to
|
|
664
677
|
* the pointer, `null`), or a programmatic `drawings.setTool`. */
|
|
665
|
-
|
|
678
|
+
"drawing:tool": {
|
|
666
679
|
type: DrawingTypeKey | null;
|
|
667
680
|
};
|
|
668
681
|
/** The magnet snap mode changed (in-chart toolbar or `drawings.setSnapMode`). */
|
|
669
|
-
|
|
682
|
+
"drawing:snap": {
|
|
670
683
|
mode: SnapMode;
|
|
671
684
|
};
|
|
672
685
|
/** Stay-in-drawing-mode changed (in-chart toolbar or `drawings.setStayMode`) — when
|
|
673
686
|
* on, finishing a drawing leaves the tool armed. */
|
|
674
|
-
|
|
687
|
+
"drawing:stay": {
|
|
675
688
|
on: boolean;
|
|
676
689
|
};
|
|
677
690
|
/** The renderer-local mode changed: measure ruler, eraser, or none — including the
|
|
678
691
|
* mutual-exclusion exits (arming a tool leaves measure/eraser). */
|
|
679
|
-
|
|
692
|
+
"drawing:mode": {
|
|
680
693
|
mode: DrawingMode;
|
|
681
694
|
};
|
|
682
695
|
/** A user drawing was removed. */
|
|
683
|
-
|
|
696
|
+
"drawing:removed": {
|
|
684
697
|
id: string;
|
|
685
698
|
};
|
|
686
699
|
/** The user requested a drawing's settings popup. */
|
|
687
|
-
|
|
700
|
+
"drawing:settings": {
|
|
688
701
|
id: string;
|
|
689
702
|
};
|
|
690
703
|
/**
|
|
@@ -695,11 +708,11 @@ interface VelaEventMap extends Record<string, unknown> {
|
|
|
695
708
|
* indicator while streaming, and only emitted for engines that expose an execution
|
|
696
709
|
* context. Native (core-computed) indicators never fire it — they run no script.
|
|
697
710
|
*/
|
|
698
|
-
|
|
711
|
+
"script:run": ScriptRun;
|
|
699
712
|
/** An indicator's execution context advanced (run finished, or throttled during
|
|
700
713
|
* streaming) — re-pull `handle.context()` if you consume it. Prefer `script:run`,
|
|
701
714
|
* which delivers the data rather than a signal to go fetch it. */
|
|
702
|
-
|
|
715
|
+
"context:changed": {
|
|
703
716
|
id: string;
|
|
704
717
|
};
|
|
705
718
|
/** A live tick: the forming bar was updated or a new bar appended. */
|
|
@@ -709,12 +722,12 @@ interface VelaEventMap extends Record<string, unknown> {
|
|
|
709
722
|
* debounced; the engine re-run debounce is separate). Payload = `{from, to}` in
|
|
710
723
|
* epoch-ms. The seam viewport-sync links between charts build on.
|
|
711
724
|
*/
|
|
712
|
-
|
|
725
|
+
"viewport:changed": {
|
|
713
726
|
from: number;
|
|
714
727
|
to: number;
|
|
715
728
|
};
|
|
716
729
|
/** A deep-history backfill chunk landed (`loaded` of `target` bars are on the chart). */
|
|
717
|
-
|
|
730
|
+
"history:progress": {
|
|
718
731
|
loaded: number;
|
|
719
732
|
target: number;
|
|
720
733
|
};
|
|
@@ -724,8 +737,8 @@ interface VelaEventMap extends Record<string, unknown> {
|
|
|
724
737
|
* the data was non-monotonic — the chart keeps what loaded. Fires exactly once, including
|
|
725
738
|
* for small/offline charts (immediately after their single load).
|
|
726
739
|
*/
|
|
727
|
-
|
|
728
|
-
reason:
|
|
740
|
+
"history:complete": {
|
|
741
|
+
reason: "depth" | "genesis" | "aborted";
|
|
729
742
|
oldestTime: number;
|
|
730
743
|
barsLoaded: number;
|
|
731
744
|
};
|
|
@@ -814,6 +827,20 @@ declare class RendererControl {
|
|
|
814
827
|
* degradation as the sync ghost crosshair.
|
|
815
828
|
*/
|
|
816
829
|
setLegendActions(provider: ((indicatorId: string) => LegendActionView[]) | null): void;
|
|
830
|
+
/**
|
|
831
|
+
* Replace the indicator legend's fold toggle with a host action (or restore it with
|
|
832
|
+
* `null`) — multi-chart shells point the chip at their indicator overview instead of
|
|
833
|
+
* unfolding rows in place. Silent no-op on a renderer without a foldable legend.
|
|
834
|
+
*/
|
|
835
|
+
setLegendOverviewAction(action: (() => void) | null): this;
|
|
836
|
+
/** Whether the active renderer can open a per-indicator settings dialog. */
|
|
837
|
+
get supportsIndicatorSettings(): boolean;
|
|
838
|
+
/**
|
|
839
|
+
* Open one indicator's settings dialog — the programmatic twin of the legend gear
|
|
840
|
+
* (see {@link supportsIndicatorSettings}). Silent no-op without the seam or for an
|
|
841
|
+
* unknown id.
|
|
842
|
+
*/
|
|
843
|
+
openIndicatorSettings(indicatorId: string): this;
|
|
817
844
|
/**
|
|
818
845
|
* Export the current chart as a PNG data URL, or null if the active renderer
|
|
819
846
|
* doesn't support it (warns). DOM overlays (tables, legend) are not included.
|
|
@@ -844,6 +871,8 @@ declare class RendererControl {
|
|
|
844
871
|
* public seam host chrome (status lines, data windows) builds on.
|
|
845
872
|
*/
|
|
846
873
|
onCrosshairMove(cb: (e: CrosshairEvent) => void): Unsubscribe;
|
|
874
|
+
/** Touch long-press on a price or time axis strip — silent no-op without the seam. */
|
|
875
|
+
onAxisLongPress(cb: (e: AxisLongPressEvent) => void): Unsubscribe;
|
|
847
876
|
/**
|
|
848
877
|
* The current data-window readout — the hovered bar's date/time and OHLCV plus every
|
|
849
878
|
* indicator's value there, each already formatted on its pane's scale (the latest bar when
|
|
@@ -889,6 +918,10 @@ declare class RendererControl {
|
|
|
889
918
|
title: string;
|
|
890
919
|
rows: readonly unknown[];
|
|
891
920
|
}>): this;
|
|
921
|
+
/** Tell the renderer's own chrome which size class the host shell is in —
|
|
922
|
+
* `'mobile'` switches its dialogs/toolbars to the touch-first presentation.
|
|
923
|
+
* Silent no-op on a renderer without adaptive chrome. */
|
|
924
|
+
setLayoutMode(mode: 'mobile' | 'desktop'): this;
|
|
892
925
|
}
|
|
893
926
|
|
|
894
927
|
/** Callback surface `PanesControl` uses to drive the orchestrator. */
|
|
@@ -1005,6 +1038,9 @@ declare class DrawingController {
|
|
|
1005
1038
|
setFavorites(types: readonly DrawingTypeKey[]): void;
|
|
1006
1039
|
private pushFavorites;
|
|
1007
1040
|
setToolbar(option: DrawingsOption): void;
|
|
1041
|
+
/** Display (or clear) another chart's in-progress placement as a ghost — silently
|
|
1042
|
+
* inert on a renderer without the optional `setExternalGhost` seam. */
|
|
1043
|
+
setExternalGhost(doc: SerializedDrawing | null): void;
|
|
1008
1044
|
/** Push per-tool shortcut hints (pre-formatted display strings) to the toolbar flyouts. */
|
|
1009
1045
|
setToolShortcuts(map: Readonly<Partial<Record<DrawingTypeKey, string>>>): void;
|
|
1010
1046
|
add(type: DrawingTypeKey, init?: AddInit): Drawing | null;
|
|
@@ -1108,6 +1144,11 @@ declare class DrawingsControl {
|
|
|
1108
1144
|
* display strings (e.g. `'Alt+T'`, `'⌥T'`) — the host owns the keymap and the
|
|
1109
1145
|
* platform formatting, so hints always match the host's actual bindings. */
|
|
1110
1146
|
setToolShortcuts(map: Readonly<Partial<Record<DrawingTypeKey, string>>>): this;
|
|
1147
|
+
/** Display another chart's in-progress placement as a GHOST at reduced opacity
|
|
1148
|
+
* (`null` clears it) — how a multi-chart host mirrors `drawing:draft` onto linked
|
|
1149
|
+
* charts. Never a real drawing: no store entry, no selection, no persistence.
|
|
1150
|
+
* Silently inert on a renderer without the optional seam. */
|
|
1151
|
+
setExternalGhost(doc: SerializedDrawing | null): this;
|
|
1111
1152
|
/** Create a drawing programmatically (no clicking). Returns it, or null if unsupported. */
|
|
1112
1153
|
add(type: DrawingTypeKey, init?: AddInit): Drawing | null;
|
|
1113
1154
|
remove(id: string): this;
|
|
@@ -1385,6 +1426,11 @@ interface WidgetActionDescriptor {
|
|
|
1385
1426
|
icon?: string;
|
|
1386
1427
|
/** Sort key within the contributed group (ascending; default 0). */
|
|
1387
1428
|
order?: number;
|
|
1429
|
+
/** Topbar only: which cluster the button joins. `'right'` (default) is the
|
|
1430
|
+
* right-hand tools cluster; `'left'` puts it with the PRIMARY chrome buttons —
|
|
1431
|
+
* right after the style/layout dropdowns, styled like them (the spot and look of
|
|
1432
|
+
* the built-in Indicators button, for actions that replace it). */
|
|
1433
|
+
align?: 'left' | 'right';
|
|
1388
1434
|
/** Runtime gate — omitted ⇒ always shown. */
|
|
1389
1435
|
when?: (ctx: WidgetContext) => boolean;
|
|
1390
1436
|
run: (ctx: WidgetContext) => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { V as VisibleRangePreset } from './options-
|
|
2
|
-
import { D as DataProvider } from './DataProvider-
|
|
3
|
-
import { S as ScriptingEngine, V as Vela } from './contributions-
|
|
1
|
+
import { V as VisibleRangePreset } from './options-XTBpbx0s.cjs';
|
|
2
|
+
import { D as DataProvider } from './DataProvider-gnzv-dgc.cjs';
|
|
3
|
+
import { S as ScriptingEngine, V as Vela } from './contributions-Ci_i3IN2.cjs';
|
|
4
4
|
|
|
5
5
|
interface RangePreset {
|
|
6
6
|
/** Button label. */
|
|
@@ -85,8 +85,12 @@ declare function resolveIndicators(config: string | IndicatorManifest | Indicato
|
|
|
85
85
|
|
|
86
86
|
/** The linkable dimensions. `crosshair` mirrors the pointer time onto same-group
|
|
87
87
|
* cells as GHOST crosshairs (renderers without the optional `setExternalCrosshair`
|
|
88
|
-
* seam simply never display one).
|
|
89
|
-
|
|
88
|
+
* seam simply never display one). `drawings` copies each NEWLY CREATED drawing onto
|
|
89
|
+
* same-group cells and keeps the set linked: edits and removals of any member
|
|
90
|
+
* follow. Link membership is session-scoped and survives a toggle-off (re-enabling
|
|
91
|
+
* resumes edit/delete for drawings paired earlier; drawings created while off stay
|
|
92
|
+
* independent). After a reload, every drawing is unpaired again. */
|
|
93
|
+
type SyncKind = 'viewport' | 'symbol' | 'timeframe' | 'crosshair' | 'drawings';
|
|
90
94
|
/**
|
|
91
95
|
* One link's configuration: `false`/absent = off; `true` = ALL cells linked (one
|
|
92
96
|
* implicit group); a record maps cell id → group name, and only cells sharing a group
|
|
@@ -98,6 +102,7 @@ interface SyncOptions {
|
|
|
98
102
|
symbol?: SyncSetting;
|
|
99
103
|
timeframe?: SyncSetting;
|
|
100
104
|
crosshair?: SyncSetting;
|
|
105
|
+
drawings?: SyncSetting;
|
|
101
106
|
}
|
|
102
107
|
/** Splitter track weights along each grid axis. */
|
|
103
108
|
interface TrackSizes {
|
|
@@ -129,6 +134,8 @@ interface CellState {
|
|
|
129
134
|
watermark?: boolean;
|
|
130
135
|
/** Indicator titles (the in-chart legend rows) visibility — a per-chart display pref. */
|
|
131
136
|
indicatorTitles?: boolean;
|
|
137
|
+
/** Plot values beside the legend titles visibility — a per-chart display pref. */
|
|
138
|
+
indicatorValues?: boolean;
|
|
132
139
|
/** The renderer's cosmetic config document (`renderer.getConfig()`). */
|
|
133
140
|
rendererConfig?: unknown;
|
|
134
141
|
/** The user-drawings document (`drawings.toJSON()`). */
|
|
@@ -247,6 +254,16 @@ interface VelaShellOptions {
|
|
|
247
254
|
statusline?: boolean;
|
|
248
255
|
watermark?: boolean;
|
|
249
256
|
bottombar?: boolean;
|
|
257
|
+
/** The built-in indicator picker's entry points — the topbar button, the mobile-bar
|
|
258
|
+
* item, and the `/` shortcut. `false` removes them, for hosts that replace the
|
|
259
|
+
* picker with their own indicator UI (e.g. a contributed topbar action opening a
|
|
260
|
+
* custom dialog). The `indicators` manifest still resolves and auto-adds. */
|
|
261
|
+
indicatorPicker?: boolean;
|
|
262
|
+
/** Chrome size class. `'auto'` (default) follows the CONTAINER width plus a
|
|
263
|
+
* coarse-pointer heuristic; `'mobile'` / `'desktop'` pin it. Mobile swaps the
|
|
264
|
+
* topbar + desktop bottombar for one touch-first bottom bar, presents pickers
|
|
265
|
+
* fullscreen and menus as bottom drawers, and enables the touch chart gestures. */
|
|
266
|
+
layoutMode?: 'auto' | 'mobile' | 'desktop';
|
|
250
267
|
/** Focus the chart when the shell mounts so keyboard shortcuts work from the first
|
|
251
268
|
* keystroke — no initial click needed. Default false: an embedded shell must never
|
|
252
269
|
* steal the page's focus from the host's own controls. */
|