@luxalgo/vela 0.6.7 → 0.6.9
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-BsQM2WNH.d.cts → DataProvider-8Z95Q-RJ.d.cts} +1 -1
- package/dist/{DataProvider-BSLlBpB9.d.ts → DataProvider-DExJrfut.d.ts} +1 -1
- package/dist/{chunk-2R7BANEM.js → chunk-62SVGONC.js} +2 -2
- package/dist/{chunk-6WFKTAT4.js → chunk-6WDDVMBJ.js} +548 -147
- package/dist/{chunk-L3I2CCYO.js → chunk-EQCHJZOT.js} +49 -2
- package/dist/{chunk-OICPLNU7.js → chunk-FCVIG7JG.js} +188 -2
- package/dist/{chunk-WVP4XV5A.js → chunk-STHSKXOR.js} +407 -159
- package/dist/{chunk-PN5KWFZ4.js → chunk-WFSZBX3R.js} +2 -2
- package/dist/{contributions-Z12BrWCy.d.ts → contributions-C1U2Krwg.d.cts} +112 -7
- package/dist/{contributions-Hv4_cOJo.d.cts → contributions-D7PVZO2i.d.ts} +112 -7
- package/dist/index.cjs +755 -152
- package/dist/index.d.cts +12 -7
- package/dist/index.d.ts +12 -7
- package/dist/index.js +4 -4
- package/dist/{options-BaVTMXaO.d.ts → options-FM0peknS.d.cts} +84 -7
- package/dist/{options-BaVTMXaO.d.cts → options-FM0peknS.d.ts} +84 -7
- package/dist/{plugin-9koBjc5H.d.ts → plugin-7bkF32Rk.d.ts} +3 -3
- package/dist/{plugin-BXhDHTYn.d.cts → plugin-DfVqBz9p.d.cts} +3 -3
- package/dist/plugin.cjs +18 -2
- 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/{bottombar-Br4rzx_R.d.ts → statusline-DOPiT6I6.d.cts} +91 -6
- package/dist/{bottombar-Div5zibZ.d.cts → statusline-zdF4eZLr.d.ts} +91 -6
- package/dist/ui.cjs +201 -4
- package/dist/ui.d.cts +89 -2
- package/dist/ui.d.ts +89 -2
- package/dist/ui.js +3 -3
- package/dist/vela.global.js +755 -152
- package/dist/vela.global.min.js +93 -44
- package/dist/widget.cjs +1144 -271
- package/dist/widget.d.cts +12 -85
- package/dist/widget.d.ts +12 -85
- package/dist/widget.js +7 -7
- package/dist/workspace.cjs +1144 -271
- package/dist/workspace.d.cts +65 -11
- package/dist/workspace.d.ts +65 -11
- package/dist/workspace.js +6 -6
- package/package.json +1 -1
|
@@ -98,11 +98,11 @@ registerIcon(
|
|
|
98
98
|
);
|
|
99
99
|
registerIcon(
|
|
100
100
|
"market-pre",
|
|
101
|
-
svg24('<path d="M12 2v8"/><path d="m4.93 10.93 1.41 1.41"/><path d="M2 18h2"/><path d="M20 18h2"/><path d="m19.07 10.93-1.41 1.41"/><path d="M22 22H2"/><path d="
|
|
101
|
+
svg24('<path d="M12 2v8"/><path d="m4.93 10.93 1.41 1.41"/><path d="M2 18h2"/><path d="M20 18h2"/><path d="m19.07 10.93-1.41 1.41"/><path d="M22 22H2"/><path d="m8 6 4-4 4 4"/><path d="M16 18a4 4 0 0 0-8 0"/>')
|
|
102
102
|
);
|
|
103
103
|
registerIcon(
|
|
104
104
|
"market-post",
|
|
105
|
-
svg24('<path d="M12 10V2"/><path d="m4.93 10.93 1.41 1.41"/><path d="M2 18h2"/><path d="M20 18h2"/><path d="m19.07 10.93-1.41 1.41"/><path d="M22 22H2"/><path d="m16
|
|
105
|
+
svg24('<path d="M12 10V2"/><path d="m4.93 10.93 1.41 1.41"/><path d="M2 18h2"/><path d="M20 18h2"/><path d="m19.07 10.93-1.41 1.41"/><path d="M22 22H2"/><path d="m16 14-4 4-4-4"/><path d="M16 6a4 4 0 0 0-8 0"/>')
|
|
106
106
|
);
|
|
107
107
|
registerIcon("market-closed", svg24('<path d="M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"/>'));
|
|
108
108
|
registerIcon(
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
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 { u as Millis, af as InputSchema, ad as IndicatorMeta, P as PriceStyle, O as OHLCV, m as InputValue, k as IndicatorModel, j as MoveTarget, ar as PaneAxis, aE as SeriesSpec, ab as Fill, B as Background, aw as PriceLine, a1 as DrawingLine, Z as DrawingBox, a0 as DrawingLabel, a5 as DrawingPolyline, a2 as DrawingLinefill, a7 as DrawingTable, g as IndicatorStatus, a as VisibleRange, c as VelaTheme, S as SerializedDrawing, w as DrawingTypeKey, v as SnapMode, a3 as DrawingMode, I as IChartRenderer, R as RendererCapabilities, o as LegendActionView, p as LegendCalloutView, U as Unsubscribe, C as CrosshairEvent, A as AxisLongPressEvent, s as DataWindowReadout, n as SymbolPickerFn, aS as PaneInfo, aa as DrawingsOption, D as Drawing, b as VelaOptions, y as AddIndicatorOptions, aq as MarketSwitch, ap as MarketSnapshot, V as VisibleRangePreset, T as ThemeName } from './options-FM0peknS.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-8Z95Q-RJ.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* A strategy's broker state at ONE bar — the flat summary a host reads while a script
|
|
@@ -92,6 +92,14 @@ interface PreparedScript {
|
|
|
92
92
|
/** The language that produced this (the engine's `language`). */
|
|
93
93
|
language: string;
|
|
94
94
|
inputs: InputSchema[];
|
|
95
|
+
/**
|
|
96
|
+
* Declaration-property schema (a strategy's `initial_capital`, an indicator's
|
|
97
|
+
* `precision`, …) — the settings dialog renders these on a "Properties" tab.
|
|
98
|
+
* `defval` is the EFFECTIVE default: the value the script declares, else the
|
|
99
|
+
* engine's configured default, else the language's own. Absent ≡ the language
|
|
100
|
+
* has no declaration properties (`capabilities.props` false).
|
|
101
|
+
*/
|
|
102
|
+
props?: InputSchema[];
|
|
95
103
|
meta: IndicatorMeta;
|
|
96
104
|
/**
|
|
97
105
|
* Whether the script references a viewport built-in (e.g. Pine
|
|
@@ -109,6 +117,9 @@ interface EngineCapabilities {
|
|
|
109
117
|
visibleRange: boolean;
|
|
110
118
|
/** Exposes an inputs schema (drives the renderer's settings dialog). */
|
|
111
119
|
inputs: boolean;
|
|
120
|
+
/** Exposes a declaration-props schema (`PreparedScript.props`) and honors prop
|
|
121
|
+
* overrides on `execute`/`update`. Absent ≡ false. */
|
|
122
|
+
props?: boolean;
|
|
112
123
|
}
|
|
113
124
|
/** Market context an execution needs. Vela owns the bars; this is the metadata. */
|
|
114
125
|
interface ExecutionMarket {
|
|
@@ -145,6 +156,9 @@ interface ExecutionRequest {
|
|
|
145
156
|
*/
|
|
146
157
|
fetchSeries?: FetchSeries;
|
|
147
158
|
inputs?: Record<string, InputValue>;
|
|
159
|
+
/** Declaration-prop overrides, keyed like `PreparedScript.props`. Only meaningful
|
|
160
|
+
* when `capabilities.props`; other engines ignore it. */
|
|
161
|
+
props?: Record<string, InputValue>;
|
|
148
162
|
visibleRange?: VisibleBarRange;
|
|
149
163
|
mode: 'static' | 'live';
|
|
150
164
|
/**
|
|
@@ -221,8 +235,10 @@ interface ExecutionSession {
|
|
|
221
235
|
getContext?(select?: ContextSelect): Promise<EngineContextSnapshot | null>;
|
|
222
236
|
/** Tear down (stops any streaming / incremental re-execution). */
|
|
223
237
|
stop(): void;
|
|
224
|
-
/** Re-run / re-stream with merged input overrides.
|
|
225
|
-
|
|
238
|
+
/** Re-run / re-stream with merged input overrides. `props` (when given) merges
|
|
239
|
+
* declaration-prop overrides the same way — a props-capable engine re-runs with
|
|
240
|
+
* both applied; others may ignore the second argument. */
|
|
241
|
+
update(inputs: Record<string, InputValue>, props?: Record<string, InputValue>): void;
|
|
226
242
|
/** Update the viewport window (re-runs viewport-dependent scripts; no-op otherwise). */
|
|
227
243
|
setVisibleRange(range: VisibleBarRange): void;
|
|
228
244
|
/** Signal that Vela's bars changed. No reason = live tick; see {@link BarsChangeReason}. */
|
|
@@ -272,10 +288,18 @@ interface IndicatorHandle {
|
|
|
272
288
|
readonly source?: string;
|
|
273
289
|
/** Inputs parsed from the Pine source (populated once the script is prepared). */
|
|
274
290
|
readonly inputs: readonly InputSchema[];
|
|
291
|
+
/** Declaration-props schema (a strategy's `initial_capital`, an indicator's
|
|
292
|
+
* `precision`, …; populated once the script is prepared). Empty when the
|
|
293
|
+
* engine exposes none. */
|
|
294
|
+
readonly props: readonly InputSchema[];
|
|
275
295
|
/** Whether the indicator is currently shown (vs hidden). Hidden indicators stop computing. */
|
|
276
296
|
readonly visible: boolean;
|
|
277
297
|
setInput(key: string, value: InputValue): void;
|
|
278
298
|
setInputs(values: Record<string, InputValue>): void;
|
|
299
|
+
/** Override one declaration prop and re-run (a prop change replays the whole script). */
|
|
300
|
+
setProp(key: string, value: InputValue): void;
|
|
301
|
+
/** Override several declaration props at once and re-run. */
|
|
302
|
+
setProps(values: Record<string, InputValue>): void;
|
|
279
303
|
/**
|
|
280
304
|
* Hide or show the indicator. Hiding **suspends** it — its visuals are dropped (the legend
|
|
281
305
|
* row stays, marked hidden) and its computation stops (the engine session is torn down), so a
|
|
@@ -459,8 +483,8 @@ interface NativeIndicatorDescriptor {
|
|
|
459
483
|
/** Full display name (picker, settings header, handle title). */
|
|
460
484
|
readonly title: string;
|
|
461
485
|
/**
|
|
462
|
-
* Compact name for the on-chart legend chip
|
|
463
|
-
*
|
|
486
|
+
* Compact name for the on-chart legend chip and the settings-dialog header.
|
|
487
|
+
* Absent ⇒ {@link title}. The picker keeps the full title either way.
|
|
464
488
|
*/
|
|
465
489
|
readonly shortTitle?: string;
|
|
466
490
|
readonly paneHint: 'price' | 'new';
|
|
@@ -800,6 +824,8 @@ interface IndicatorSummary {
|
|
|
800
824
|
barColors: number;
|
|
801
825
|
trades: number;
|
|
802
826
|
inputs: number;
|
|
827
|
+
/** Elements flagged `force_overlay` (routed to the price pane), across every kind. */
|
|
828
|
+
forcedOverlay: number;
|
|
803
829
|
}
|
|
804
830
|
/** A snapshot of everything the Vela core has generated for the mounted indicators. */
|
|
805
831
|
interface SceneInspection {
|
|
@@ -819,6 +845,7 @@ interface SceneInspection {
|
|
|
819
845
|
tables: number;
|
|
820
846
|
barColors: number;
|
|
821
847
|
trades: number;
|
|
848
|
+
forcedOverlay: number;
|
|
822
849
|
};
|
|
823
850
|
}
|
|
824
851
|
|
|
@@ -853,6 +880,13 @@ declare class RendererControl {
|
|
|
853
880
|
* degradation as the sync ghost crosshair.
|
|
854
881
|
*/
|
|
855
882
|
setLegendActions(provider: ((indicatorId: string) => LegendActionView[]) | null): void;
|
|
883
|
+
/**
|
|
884
|
+
* Wire the legend rows' HOST-CONTRIBUTED callout bubbles (the shells route the
|
|
885
|
+
* plugin registry through this; see `registerLegendCallout`). Silent on a renderer
|
|
886
|
+
* without the seam — contributed callouts simply never show there, same graceful
|
|
887
|
+
* degradation as {@link setLegendActions}.
|
|
888
|
+
*/
|
|
889
|
+
setLegendCallouts(provider: ((indicatorId: string) => LegendCalloutView[]) | null): void;
|
|
856
890
|
/**
|
|
857
891
|
* Replace the indicator legend's fold toggle with a host action (or restore it with
|
|
858
892
|
* `null`) — multi-chart shells point the chip at their indicator overview instead of
|
|
@@ -1439,6 +1473,10 @@ interface WidgetContext {
|
|
|
1439
1473
|
* a shell may replace its chart instance, and a captured one would be destroyed.
|
|
1440
1474
|
* (Symbol and timeframe switches are applied IN PLACE — the instance survives them.) */
|
|
1441
1475
|
chart: Vela;
|
|
1476
|
+
/** LIVE getters, like `chart` — they resolve the ACTIVE cell's market at every
|
|
1477
|
+
* read, so an attachment that holds its mount context keeps reading the truth
|
|
1478
|
+
* after a symbol/timeframe switch. Read them at the point of use; never copy
|
|
1479
|
+
* them into long-lived state. */
|
|
1442
1480
|
symbol: string;
|
|
1443
1481
|
timeframe: string;
|
|
1444
1482
|
priceStyle: string;
|
|
@@ -1485,9 +1523,18 @@ interface WidgetActionDescriptor {
|
|
|
1485
1523
|
/** Stable id — re-registering an id replaces it. */
|
|
1486
1524
|
id: string;
|
|
1487
1525
|
target: WidgetActionTarget;
|
|
1526
|
+
/** Always required, even icon-only: it is the button's aria-label and tooltip, the
|
|
1527
|
+
* mobile drawer row's text, and the context-menu item's label. */
|
|
1488
1528
|
label: string;
|
|
1489
1529
|
/** Icon id from the `vela/ui` icon registry (register yours with `registerIcon`). */
|
|
1490
1530
|
icon?: string;
|
|
1531
|
+
/** Topbar only: render the DESKTOP button icon-only, like the built-in tools — the
|
|
1532
|
+
* `label` moves to the aria-label and a kit tooltip instead of button text (mobile
|
|
1533
|
+
* surfaces keep their text). The right cluster gets the native 32px tool look; the
|
|
1534
|
+
* left cluster keeps the primary chrome, minus the text. Requires `icon` — without
|
|
1535
|
+
* one the flag is ignored (with a console warning) and the label renders. The piece
|
|
1536
|
+
* that makes a `'screenshot'` slot override pixel-faithful to the native button. */
|
|
1537
|
+
iconOnly?: boolean;
|
|
1491
1538
|
/** Sort key within the contributed group (ascending; default 0). */
|
|
1492
1539
|
order?: number;
|
|
1493
1540
|
/** Topbar only: which cluster the button joins. `'right'` (default) is the
|
|
@@ -1635,6 +1682,64 @@ declare function registerLegendAction(desc: LegendActionDescriptor): () => void;
|
|
|
1635
1682
|
declare function unregisterLegendAction(id: string): void;
|
|
1636
1683
|
/** Every registered legend action, `order`-sorted (registration order breaks ties). */
|
|
1637
1684
|
declare function legendActions(): LegendActionDescriptor[];
|
|
1685
|
+
/** One block of a legend callout's deployed panel, descriptor-side: plain text, or a
|
|
1686
|
+
* button whose `run` receives the shell's {@link WidgetContext} and the row's
|
|
1687
|
+
* indicator — the same signature as a legend action's `run`. */
|
|
1688
|
+
type LegendCalloutItem = {
|
|
1689
|
+
type: 'text';
|
|
1690
|
+
text: string;
|
|
1691
|
+
} | {
|
|
1692
|
+
type: 'button';
|
|
1693
|
+
label: string;
|
|
1694
|
+
/** Emphasized (selection-colored) button — the panel's main action. */
|
|
1695
|
+
primary?: boolean;
|
|
1696
|
+
/** Close the panel after `run` (default true). */
|
|
1697
|
+
close?: boolean;
|
|
1698
|
+
run(ctx: WidgetContext, indicator: LegendIndicatorInfo): void;
|
|
1699
|
+
};
|
|
1700
|
+
/** The panel a clickable callout deploys: an optional heading over ordered blocks. */
|
|
1701
|
+
interface LegendCalloutContent {
|
|
1702
|
+
title?: string;
|
|
1703
|
+
items: LegendCalloutItem[];
|
|
1704
|
+
}
|
|
1705
|
+
/** A callout's resolved presentation for one row — what {@link LegendCalloutDescriptor.callout} returns. */
|
|
1706
|
+
interface LegendCalloutSpec {
|
|
1707
|
+
/** Icon id from the `vela/ui` icon registry (register yours with `registerIcon`). */
|
|
1708
|
+
icon: string;
|
|
1709
|
+
/** Bubble fill — any CSS color (`color-mix` token washes match the built-in badges). */
|
|
1710
|
+
background: string;
|
|
1711
|
+
/** Icon ink (default: the legend row's text color). */
|
|
1712
|
+
color?: string;
|
|
1713
|
+
/** Hover text; also the bubble's accessible name. */
|
|
1714
|
+
tooltip: string;
|
|
1715
|
+
/** Deployed panel — presence makes the bubble clickable. */
|
|
1716
|
+
content?: LegendCalloutContent;
|
|
1717
|
+
}
|
|
1718
|
+
/**
|
|
1719
|
+
* A contributed LEGEND CALLOUT: a small tinted bubble with a centered icon, always
|
|
1720
|
+
* visible right of the indicator's legend title (trailing the whole row while its
|
|
1721
|
+
* hover controls are out). When the spec carries `content`, clicking the bubble
|
|
1722
|
+
* deploys that panel — below it, flipping above near the bottom screen edge.
|
|
1723
|
+
*
|
|
1724
|
+
* Unlike a legend action's static icon, a callout's whole presentation is resolved
|
|
1725
|
+
* per row through `callout` — return `null` to show none (the per-indicator gate),
|
|
1726
|
+
* or a spec whose icon/tint/panel follow your own state (a market-status bubble
|
|
1727
|
+
* changes dress as sessions roll). Late state changes re-project through the shells'
|
|
1728
|
+
* `refreshActions()`, like every contribution.
|
|
1729
|
+
*/
|
|
1730
|
+
interface LegendCalloutDescriptor {
|
|
1731
|
+
/** Stable id — re-registering an id replaces it. */
|
|
1732
|
+
id: string;
|
|
1733
|
+
/** Sort key within the contributed group (ascending; default 0). */
|
|
1734
|
+
order?: number;
|
|
1735
|
+
/** Resolve the row's bubble — `null`/`undefined` shows none. */
|
|
1736
|
+
callout(indicator: LegendIndicatorInfo): LegendCalloutSpec | null | undefined;
|
|
1737
|
+
}
|
|
1738
|
+
/** Register (or replace) a legend callout. Returns an unregister disposer. */
|
|
1739
|
+
declare function registerLegendCallout(desc: LegendCalloutDescriptor): () => void;
|
|
1740
|
+
declare function unregisterLegendCallout(id: string): void;
|
|
1741
|
+
/** Every registered legend callout, `order`-sorted (registration order breaks ties). */
|
|
1742
|
+
declare function legendCallouts(): LegendCalloutDescriptor[];
|
|
1638
1743
|
/**
|
|
1639
1744
|
* The surface a `scope: 'cell'` persistence handler works against — bound to ONE cell
|
|
1640
1745
|
* (never the active one by proxy), because serialize/restore run per cell, including
|
|
@@ -1729,4 +1834,4 @@ declare function unregisterDefaultEngine(language: string): void;
|
|
|
1729
1834
|
* language. The shell layers (widget, workspace cell) register exactly this result. */
|
|
1730
1835
|
declare function resolveEngines(overrides?: Record<string, EngineFactory>): Record<string, EngineFactory>;
|
|
1731
1836
|
|
|
1732
|
-
export {
|
|
1837
|
+
export { TypedEventBus as $, type RunIndicatorResult as A, type BarsChangeReason as B, type CellStateContext as C, type DrawingsDocument as D, type ExternalIndicatorEntry as E, type FetchSeries as F, type SceneInspection as G, type ScriptRunCause as H, type IndicatorHandle as I, type ScriptRunResult as J, type SidePanelButton as K, type LegendActionDescriptor as L, type SidePanelDescriptor as M, type NativeIndicator as N, OVERRIDABLE_TOPBAR_IDS as O, type ParsedSymbol as P, type SidePanelHandle as Q, type Resolved as R, type ScriptingEngine as S, type SidePanelHeader as T, type StatePersistenceHandler as U, Vela as V, type WidgetContext as W, type StrategyFill as X, type StrategyState as Y, type StrategyTrade as Z, type SymbolRankingHook as _, type ScriptRun as a, type VelaDeps as a0, type VelaEventMap as a1, type VisibleBarRange as a2, type WidgetActionDescriptor as a3, type WidgetActionTarget as a4, type WidgetAttachment as a5, getNativeIndicator as a6, legendActions as a7, legendCallouts as a8, nativeIndicatorDescriptors as a9, nativeIndicatorTypes as aa, registerDefaultEngine as ab, registerLegendAction as ac, registerLegendCallout as ad, registerNativeIndicator as ae, registerSidePanel as af, registerStatePersistence as ag, registerSymbolRanking as ah, registerWidgetAction as ai, registerWidgetAttachment as aj, resolveEngines as ak, sidePanels as al, statePersistenceHandlers as am, symbolRanking as an, topbarActionOverride as ao, unregisterDefaultEngine as ap, unregisterLegendAction as aq, unregisterLegendCallout as ar, unregisterNativeIndicator as as, unregisterSidePanel as at, unregisterStatePersistence as au, unregisterWidgetAction as av, unregisterWidgetAttachment as aw, widgetActions as ax, widgetAttachments as ay, DEFAULT_PANEL_ORDER as az, type ContextSelect as b, DataControl as c, DrawingsControl as d, type EngineAlert as e, type EngineCapabilities as f, type EngineContextSnapshot as g, type EngineFactory as h, type EngineWarning as i, type ExecutionHandlers as j, type ExecutionMarket as k, type ExecutionRequest as l, type ExecutionSession as m, type IndicatorEventMap as n, type IndicatorSummary as o, type LegendCalloutContent as p, type LegendCalloutDescriptor as q, type LegendCalloutItem as r, type LegendCalloutSpec as s, type LegendIndicatorInfo as t, type NativeIndicatorContext as u, type NativeIndicatorDescriptor as v, type NativeIndicatorInfo as w, type NativeIndicatorOutput as x, type PreparedScript as y, RendererControl as z };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
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 { u as Millis, af as InputSchema, ad as IndicatorMeta, P as PriceStyle, O as OHLCV, m as InputValue, k as IndicatorModel, j as MoveTarget, ar as PaneAxis, aE as SeriesSpec, ab as Fill, B as Background, aw as PriceLine, a1 as DrawingLine, Z as DrawingBox, a0 as DrawingLabel, a5 as DrawingPolyline, a2 as DrawingLinefill, a7 as DrawingTable, g as IndicatorStatus, a as VisibleRange, c as VelaTheme, S as SerializedDrawing, w as DrawingTypeKey, v as SnapMode, a3 as DrawingMode, I as IChartRenderer, R as RendererCapabilities, o as LegendActionView, p as LegendCalloutView, U as Unsubscribe, C as CrosshairEvent, A as AxisLongPressEvent, s as DataWindowReadout, n as SymbolPickerFn, aS as PaneInfo, aa as DrawingsOption, D as Drawing, b as VelaOptions, y as AddIndicatorOptions, aq as MarketSwitch, ap as MarketSnapshot, V as VisibleRangePreset, T as ThemeName } from './options-FM0peknS.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-DExJrfut.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* A strategy's broker state at ONE bar — the flat summary a host reads while a script
|
|
@@ -92,6 +92,14 @@ interface PreparedScript {
|
|
|
92
92
|
/** The language that produced this (the engine's `language`). */
|
|
93
93
|
language: string;
|
|
94
94
|
inputs: InputSchema[];
|
|
95
|
+
/**
|
|
96
|
+
* Declaration-property schema (a strategy's `initial_capital`, an indicator's
|
|
97
|
+
* `precision`, …) — the settings dialog renders these on a "Properties" tab.
|
|
98
|
+
* `defval` is the EFFECTIVE default: the value the script declares, else the
|
|
99
|
+
* engine's configured default, else the language's own. Absent ≡ the language
|
|
100
|
+
* has no declaration properties (`capabilities.props` false).
|
|
101
|
+
*/
|
|
102
|
+
props?: InputSchema[];
|
|
95
103
|
meta: IndicatorMeta;
|
|
96
104
|
/**
|
|
97
105
|
* Whether the script references a viewport built-in (e.g. Pine
|
|
@@ -109,6 +117,9 @@ interface EngineCapabilities {
|
|
|
109
117
|
visibleRange: boolean;
|
|
110
118
|
/** Exposes an inputs schema (drives the renderer's settings dialog). */
|
|
111
119
|
inputs: boolean;
|
|
120
|
+
/** Exposes a declaration-props schema (`PreparedScript.props`) and honors prop
|
|
121
|
+
* overrides on `execute`/`update`. Absent ≡ false. */
|
|
122
|
+
props?: boolean;
|
|
112
123
|
}
|
|
113
124
|
/** Market context an execution needs. Vela owns the bars; this is the metadata. */
|
|
114
125
|
interface ExecutionMarket {
|
|
@@ -145,6 +156,9 @@ interface ExecutionRequest {
|
|
|
145
156
|
*/
|
|
146
157
|
fetchSeries?: FetchSeries;
|
|
147
158
|
inputs?: Record<string, InputValue>;
|
|
159
|
+
/** Declaration-prop overrides, keyed like `PreparedScript.props`. Only meaningful
|
|
160
|
+
* when `capabilities.props`; other engines ignore it. */
|
|
161
|
+
props?: Record<string, InputValue>;
|
|
148
162
|
visibleRange?: VisibleBarRange;
|
|
149
163
|
mode: 'static' | 'live';
|
|
150
164
|
/**
|
|
@@ -221,8 +235,10 @@ interface ExecutionSession {
|
|
|
221
235
|
getContext?(select?: ContextSelect): Promise<EngineContextSnapshot | null>;
|
|
222
236
|
/** Tear down (stops any streaming / incremental re-execution). */
|
|
223
237
|
stop(): void;
|
|
224
|
-
/** Re-run / re-stream with merged input overrides.
|
|
225
|
-
|
|
238
|
+
/** Re-run / re-stream with merged input overrides. `props` (when given) merges
|
|
239
|
+
* declaration-prop overrides the same way — a props-capable engine re-runs with
|
|
240
|
+
* both applied; others may ignore the second argument. */
|
|
241
|
+
update(inputs: Record<string, InputValue>, props?: Record<string, InputValue>): void;
|
|
226
242
|
/** Update the viewport window (re-runs viewport-dependent scripts; no-op otherwise). */
|
|
227
243
|
setVisibleRange(range: VisibleBarRange): void;
|
|
228
244
|
/** Signal that Vela's bars changed. No reason = live tick; see {@link BarsChangeReason}. */
|
|
@@ -272,10 +288,18 @@ interface IndicatorHandle {
|
|
|
272
288
|
readonly source?: string;
|
|
273
289
|
/** Inputs parsed from the Pine source (populated once the script is prepared). */
|
|
274
290
|
readonly inputs: readonly InputSchema[];
|
|
291
|
+
/** Declaration-props schema (a strategy's `initial_capital`, an indicator's
|
|
292
|
+
* `precision`, …; populated once the script is prepared). Empty when the
|
|
293
|
+
* engine exposes none. */
|
|
294
|
+
readonly props: readonly InputSchema[];
|
|
275
295
|
/** Whether the indicator is currently shown (vs hidden). Hidden indicators stop computing. */
|
|
276
296
|
readonly visible: boolean;
|
|
277
297
|
setInput(key: string, value: InputValue): void;
|
|
278
298
|
setInputs(values: Record<string, InputValue>): void;
|
|
299
|
+
/** Override one declaration prop and re-run (a prop change replays the whole script). */
|
|
300
|
+
setProp(key: string, value: InputValue): void;
|
|
301
|
+
/** Override several declaration props at once and re-run. */
|
|
302
|
+
setProps(values: Record<string, InputValue>): void;
|
|
279
303
|
/**
|
|
280
304
|
* Hide or show the indicator. Hiding **suspends** it — its visuals are dropped (the legend
|
|
281
305
|
* row stays, marked hidden) and its computation stops (the engine session is torn down), so a
|
|
@@ -459,8 +483,8 @@ interface NativeIndicatorDescriptor {
|
|
|
459
483
|
/** Full display name (picker, settings header, handle title). */
|
|
460
484
|
readonly title: string;
|
|
461
485
|
/**
|
|
462
|
-
* Compact name for the on-chart legend chip
|
|
463
|
-
*
|
|
486
|
+
* Compact name for the on-chart legend chip and the settings-dialog header.
|
|
487
|
+
* Absent ⇒ {@link title}. The picker keeps the full title either way.
|
|
464
488
|
*/
|
|
465
489
|
readonly shortTitle?: string;
|
|
466
490
|
readonly paneHint: 'price' | 'new';
|
|
@@ -800,6 +824,8 @@ interface IndicatorSummary {
|
|
|
800
824
|
barColors: number;
|
|
801
825
|
trades: number;
|
|
802
826
|
inputs: number;
|
|
827
|
+
/** Elements flagged `force_overlay` (routed to the price pane), across every kind. */
|
|
828
|
+
forcedOverlay: number;
|
|
803
829
|
}
|
|
804
830
|
/** A snapshot of everything the Vela core has generated for the mounted indicators. */
|
|
805
831
|
interface SceneInspection {
|
|
@@ -819,6 +845,7 @@ interface SceneInspection {
|
|
|
819
845
|
tables: number;
|
|
820
846
|
barColors: number;
|
|
821
847
|
trades: number;
|
|
848
|
+
forcedOverlay: number;
|
|
822
849
|
};
|
|
823
850
|
}
|
|
824
851
|
|
|
@@ -853,6 +880,13 @@ declare class RendererControl {
|
|
|
853
880
|
* degradation as the sync ghost crosshair.
|
|
854
881
|
*/
|
|
855
882
|
setLegendActions(provider: ((indicatorId: string) => LegendActionView[]) | null): void;
|
|
883
|
+
/**
|
|
884
|
+
* Wire the legend rows' HOST-CONTRIBUTED callout bubbles (the shells route the
|
|
885
|
+
* plugin registry through this; see `registerLegendCallout`). Silent on a renderer
|
|
886
|
+
* without the seam — contributed callouts simply never show there, same graceful
|
|
887
|
+
* degradation as {@link setLegendActions}.
|
|
888
|
+
*/
|
|
889
|
+
setLegendCallouts(provider: ((indicatorId: string) => LegendCalloutView[]) | null): void;
|
|
856
890
|
/**
|
|
857
891
|
* Replace the indicator legend's fold toggle with a host action (or restore it with
|
|
858
892
|
* `null`) — multi-chart shells point the chip at their indicator overview instead of
|
|
@@ -1439,6 +1473,10 @@ interface WidgetContext {
|
|
|
1439
1473
|
* a shell may replace its chart instance, and a captured one would be destroyed.
|
|
1440
1474
|
* (Symbol and timeframe switches are applied IN PLACE — the instance survives them.) */
|
|
1441
1475
|
chart: Vela;
|
|
1476
|
+
/** LIVE getters, like `chart` — they resolve the ACTIVE cell's market at every
|
|
1477
|
+
* read, so an attachment that holds its mount context keeps reading the truth
|
|
1478
|
+
* after a symbol/timeframe switch. Read them at the point of use; never copy
|
|
1479
|
+
* them into long-lived state. */
|
|
1442
1480
|
symbol: string;
|
|
1443
1481
|
timeframe: string;
|
|
1444
1482
|
priceStyle: string;
|
|
@@ -1485,9 +1523,18 @@ interface WidgetActionDescriptor {
|
|
|
1485
1523
|
/** Stable id — re-registering an id replaces it. */
|
|
1486
1524
|
id: string;
|
|
1487
1525
|
target: WidgetActionTarget;
|
|
1526
|
+
/** Always required, even icon-only: it is the button's aria-label and tooltip, the
|
|
1527
|
+
* mobile drawer row's text, and the context-menu item's label. */
|
|
1488
1528
|
label: string;
|
|
1489
1529
|
/** Icon id from the `vela/ui` icon registry (register yours with `registerIcon`). */
|
|
1490
1530
|
icon?: string;
|
|
1531
|
+
/** Topbar only: render the DESKTOP button icon-only, like the built-in tools — the
|
|
1532
|
+
* `label` moves to the aria-label and a kit tooltip instead of button text (mobile
|
|
1533
|
+
* surfaces keep their text). The right cluster gets the native 32px tool look; the
|
|
1534
|
+
* left cluster keeps the primary chrome, minus the text. Requires `icon` — without
|
|
1535
|
+
* one the flag is ignored (with a console warning) and the label renders. The piece
|
|
1536
|
+
* that makes a `'screenshot'` slot override pixel-faithful to the native button. */
|
|
1537
|
+
iconOnly?: boolean;
|
|
1491
1538
|
/** Sort key within the contributed group (ascending; default 0). */
|
|
1492
1539
|
order?: number;
|
|
1493
1540
|
/** Topbar only: which cluster the button joins. `'right'` (default) is the
|
|
@@ -1635,6 +1682,64 @@ declare function registerLegendAction(desc: LegendActionDescriptor): () => void;
|
|
|
1635
1682
|
declare function unregisterLegendAction(id: string): void;
|
|
1636
1683
|
/** Every registered legend action, `order`-sorted (registration order breaks ties). */
|
|
1637
1684
|
declare function legendActions(): LegendActionDescriptor[];
|
|
1685
|
+
/** One block of a legend callout's deployed panel, descriptor-side: plain text, or a
|
|
1686
|
+
* button whose `run` receives the shell's {@link WidgetContext} and the row's
|
|
1687
|
+
* indicator — the same signature as a legend action's `run`. */
|
|
1688
|
+
type LegendCalloutItem = {
|
|
1689
|
+
type: 'text';
|
|
1690
|
+
text: string;
|
|
1691
|
+
} | {
|
|
1692
|
+
type: 'button';
|
|
1693
|
+
label: string;
|
|
1694
|
+
/** Emphasized (selection-colored) button — the panel's main action. */
|
|
1695
|
+
primary?: boolean;
|
|
1696
|
+
/** Close the panel after `run` (default true). */
|
|
1697
|
+
close?: boolean;
|
|
1698
|
+
run(ctx: WidgetContext, indicator: LegendIndicatorInfo): void;
|
|
1699
|
+
};
|
|
1700
|
+
/** The panel a clickable callout deploys: an optional heading over ordered blocks. */
|
|
1701
|
+
interface LegendCalloutContent {
|
|
1702
|
+
title?: string;
|
|
1703
|
+
items: LegendCalloutItem[];
|
|
1704
|
+
}
|
|
1705
|
+
/** A callout's resolved presentation for one row — what {@link LegendCalloutDescriptor.callout} returns. */
|
|
1706
|
+
interface LegendCalloutSpec {
|
|
1707
|
+
/** Icon id from the `vela/ui` icon registry (register yours with `registerIcon`). */
|
|
1708
|
+
icon: string;
|
|
1709
|
+
/** Bubble fill — any CSS color (`color-mix` token washes match the built-in badges). */
|
|
1710
|
+
background: string;
|
|
1711
|
+
/** Icon ink (default: the legend row's text color). */
|
|
1712
|
+
color?: string;
|
|
1713
|
+
/** Hover text; also the bubble's accessible name. */
|
|
1714
|
+
tooltip: string;
|
|
1715
|
+
/** Deployed panel — presence makes the bubble clickable. */
|
|
1716
|
+
content?: LegendCalloutContent;
|
|
1717
|
+
}
|
|
1718
|
+
/**
|
|
1719
|
+
* A contributed LEGEND CALLOUT: a small tinted bubble with a centered icon, always
|
|
1720
|
+
* visible right of the indicator's legend title (trailing the whole row while its
|
|
1721
|
+
* hover controls are out). When the spec carries `content`, clicking the bubble
|
|
1722
|
+
* deploys that panel — below it, flipping above near the bottom screen edge.
|
|
1723
|
+
*
|
|
1724
|
+
* Unlike a legend action's static icon, a callout's whole presentation is resolved
|
|
1725
|
+
* per row through `callout` — return `null` to show none (the per-indicator gate),
|
|
1726
|
+
* or a spec whose icon/tint/panel follow your own state (a market-status bubble
|
|
1727
|
+
* changes dress as sessions roll). Late state changes re-project through the shells'
|
|
1728
|
+
* `refreshActions()`, like every contribution.
|
|
1729
|
+
*/
|
|
1730
|
+
interface LegendCalloutDescriptor {
|
|
1731
|
+
/** Stable id — re-registering an id replaces it. */
|
|
1732
|
+
id: string;
|
|
1733
|
+
/** Sort key within the contributed group (ascending; default 0). */
|
|
1734
|
+
order?: number;
|
|
1735
|
+
/** Resolve the row's bubble — `null`/`undefined` shows none. */
|
|
1736
|
+
callout(indicator: LegendIndicatorInfo): LegendCalloutSpec | null | undefined;
|
|
1737
|
+
}
|
|
1738
|
+
/** Register (or replace) a legend callout. Returns an unregister disposer. */
|
|
1739
|
+
declare function registerLegendCallout(desc: LegendCalloutDescriptor): () => void;
|
|
1740
|
+
declare function unregisterLegendCallout(id: string): void;
|
|
1741
|
+
/** Every registered legend callout, `order`-sorted (registration order breaks ties). */
|
|
1742
|
+
declare function legendCallouts(): LegendCalloutDescriptor[];
|
|
1638
1743
|
/**
|
|
1639
1744
|
* The surface a `scope: 'cell'` persistence handler works against — bound to ONE cell
|
|
1640
1745
|
* (never the active one by proxy), because serialize/restore run per cell, including
|
|
@@ -1729,4 +1834,4 @@ declare function unregisterDefaultEngine(language: string): void;
|
|
|
1729
1834
|
* language. The shell layers (widget, workspace cell) register exactly this result. */
|
|
1730
1835
|
declare function resolveEngines(overrides?: Record<string, EngineFactory>): Record<string, EngineFactory>;
|
|
1731
1836
|
|
|
1732
|
-
export {
|
|
1837
|
+
export { TypedEventBus as $, type RunIndicatorResult as A, type BarsChangeReason as B, type CellStateContext as C, type DrawingsDocument as D, type ExternalIndicatorEntry as E, type FetchSeries as F, type SceneInspection as G, type ScriptRunCause as H, type IndicatorHandle as I, type ScriptRunResult as J, type SidePanelButton as K, type LegendActionDescriptor as L, type SidePanelDescriptor as M, type NativeIndicator as N, OVERRIDABLE_TOPBAR_IDS as O, type ParsedSymbol as P, type SidePanelHandle as Q, type Resolved as R, type ScriptingEngine as S, type SidePanelHeader as T, type StatePersistenceHandler as U, Vela as V, type WidgetContext as W, type StrategyFill as X, type StrategyState as Y, type StrategyTrade as Z, type SymbolRankingHook as _, type ScriptRun as a, type VelaDeps as a0, type VelaEventMap as a1, type VisibleBarRange as a2, type WidgetActionDescriptor as a3, type WidgetActionTarget as a4, type WidgetAttachment as a5, getNativeIndicator as a6, legendActions as a7, legendCallouts as a8, nativeIndicatorDescriptors as a9, nativeIndicatorTypes as aa, registerDefaultEngine as ab, registerLegendAction as ac, registerLegendCallout as ad, registerNativeIndicator as ae, registerSidePanel as af, registerStatePersistence as ag, registerSymbolRanking as ah, registerWidgetAction as ai, registerWidgetAttachment as aj, resolveEngines as ak, sidePanels as al, statePersistenceHandlers as am, symbolRanking as an, topbarActionOverride as ao, unregisterDefaultEngine as ap, unregisterLegendAction as aq, unregisterLegendCallout as ar, unregisterNativeIndicator as as, unregisterSidePanel as at, unregisterStatePersistence as au, unregisterWidgetAction as av, unregisterWidgetAttachment as aw, widgetActions as ax, widgetAttachments as ay, DEFAULT_PANEL_ORDER as az, type ContextSelect as b, DataControl as c, DrawingsControl as d, type EngineAlert as e, type EngineCapabilities as f, type EngineContextSnapshot as g, type EngineFactory as h, type EngineWarning as i, type ExecutionHandlers as j, type ExecutionMarket as k, type ExecutionRequest as l, type ExecutionSession as m, type IndicatorEventMap as n, type IndicatorSummary as o, type LegendCalloutContent as p, type LegendCalloutDescriptor as q, type LegendCalloutItem as r, type LegendCalloutSpec as s, type LegendIndicatorInfo as t, type NativeIndicatorContext as u, type NativeIndicatorDescriptor as v, type NativeIndicatorInfo as w, type NativeIndicatorOutput as x, type PreparedScript as y, RendererControl as z };
|