@luxalgo/vela 0.8.1 → 0.8.3
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/README.md +1 -1
- package/dist/{DataProvider-DwFIoV4r.d.ts → DataProvider-oH78tYXL.d.ts} +1 -1
- package/dist/{DataProvider-BrlxntPN.d.cts → DataProvider-wbtJ3-Sa.d.cts} +1 -1
- package/dist/{chunk-DBDXKZUF.js → chunk-2IPXYM4B.js} +306 -177
- package/dist/{chunk-NELQJCGK.js → chunk-G7B7ZCBF.js} +167 -10
- package/dist/{chunk-ATGTCWHJ.js → chunk-HMHA733L.js} +473 -196
- package/dist/{chunk-EZ5FWVLA.js → chunk-KWI3YDBW.js} +343 -17
- package/dist/{chunk-LMBYEGUR.js → chunk-TO3GIK7Z.js} +71 -6
- package/dist/{chunk-BZQM2XO7.js → chunk-VHGACEHO.js} +62 -1
- package/dist/{contributions-tjNExo1o.d.ts → contributions-BhOBRenr.d.cts} +79 -12
- package/dist/{contributions-CtlptxR8.d.cts → contributions-HGqnNb_P.d.ts} +79 -12
- package/dist/index.cjs +733 -113
- package/dist/index.d.cts +34 -14
- package/dist/index.d.ts +34 -14
- package/dist/index.js +5 -5
- package/dist/{options-BnEPUuVV.d.ts → options-lMUwmRwh.d.cts} +69 -4
- package/dist/{options-BnEPUuVV.d.cts → options-lMUwmRwh.d.ts} +69 -4
- package/dist/{plugin-e2WUEtiI.d.ts → plugin-Cr2Pj8q8.d.ts} +4 -4
- package/dist/{plugin-BWxJRKzS.d.cts → plugin-Do5J5xuF.d.cts} +4 -4
- package/dist/plugin.cjs +38 -6
- package/dist/plugin.d.cts +5 -5
- package/dist/plugin.d.ts +5 -5
- package/dist/plugin.js +3 -3
- 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/{side-panel-HF0IAzwf.d.cts → side-panel-_2UK1gSm.d.cts} +58 -3
- package/dist/{side-panel-HF0IAzwf.d.ts → side-panel-_2UK1gSm.d.ts} +58 -3
- package/dist/{statusline-model-DFY7tuHj.d.cts → statusline-model-B-2xGlB_.d.cts} +3 -3
- package/dist/{statusline-model-zKXtGIjj.d.ts → statusline-model-CY1wzxHg.d.ts} +3 -3
- package/dist/ui.cjs +298 -13
- package/dist/ui.d.cts +132 -74
- package/dist/ui.d.ts +132 -74
- package/dist/ui.js +3 -3
- package/dist/vela.global.js +734 -114
- package/dist/vela.global.min.js +86 -52
- package/dist/widget.cjs +1227 -211
- package/dist/widget.d.cts +36 -12
- package/dist/widget.d.ts +36 -12
- package/dist/widget.js +7 -7
- package/dist/workspace.cjs +1226 -211
- package/dist/workspace.d.cts +47 -20
- package/dist/workspace.d.ts +47 -20
- package/dist/workspace.js +6 -6
- package/package.json +2 -2
- /package/dist/{chunk-JU4CWEBF.js → chunk-W5YPYZ2P.js} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { x as Millis, ao as InputSchema, am as IndicatorMeta, P as PriceStyle, O as OHLCV, I as InputValue, l as IndicatorModel, k as MoveTarget, aH as PaneAxis,
|
|
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 { x as Millis, ao as InputSchema, am as IndicatorMeta, P as PriceStyle, O as OHLCV, I as InputValue, l as IndicatorModel, k as MoveTarget, aH as PaneAxis, a_ as SeriesSpec, ak as Fill, H as Background, aQ as PriceLine, a7 as DrawingLine, a3 as DrawingBox, a6 as DrawingLabel, ab as DrawingPolyline, a8 as DrawingLinefill, ag as DrawingTable, h as IndicatorStatus, a as VisibleRange, c as VelaTheme, S as SerializedDrawing, z as DrawingTypeKey, y as SnapMode, a9 as DrawingMode, u as MarkClickEvent, e as IChartRenderer, R as RendererCapabilities, o as LegendActionView, p as LegendCalloutView, U as Unsubscribe, C as CrosshairEvent, r as ClickEvent, A as AxisLongPressEvent, v as DataWindowReadout, n as SymbolPickerFn, W as WallClock, bg as PaneInfo, aj as DrawingsOption, ad as DrawingSeriesGateway, D as Drawing, s as TimelineMark, t as MarkGroup, b as VelaOptions, F as AddIndicatorOptions, aG as MarketSwitch, E as MarketSnapshot, V as VisibleRangePreset, T as ThemeName } from './options-lMUwmRwh.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-wbtJ3-Sa.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* A strategy's broker state at ONE bar — the flat summary a host reads while a script
|
|
@@ -292,6 +292,13 @@ interface IndicatorEventMap extends Record<string, unknown> {
|
|
|
292
292
|
time: number;
|
|
293
293
|
};
|
|
294
294
|
}
|
|
295
|
+
/** How a {@link IndicatorHandle.updateCode} call ended. Never a rejection. */
|
|
296
|
+
interface CodeUpdateResult {
|
|
297
|
+
/** The new code is the one running (or, hidden, the one that will run when shown). */
|
|
298
|
+
ok: boolean;
|
|
299
|
+
/** Why the update did not land — the previous code is running again. Null on success. */
|
|
300
|
+
error: Error | null;
|
|
301
|
+
}
|
|
295
302
|
/**
|
|
296
303
|
* What `chart.addIndicator(...)` returns to the developer. The handle is usable
|
|
297
304
|
* synchronously; data renders when execution resolves (see `on('ready')`).
|
|
@@ -331,13 +338,23 @@ interface IndicatorHandle {
|
|
|
331
338
|
* Replace the script and re-run it **in place** — same `id`, same legend row, same
|
|
332
339
|
* pane placement, same handle; the seam for a host editor's "run my edit" and for a
|
|
333
340
|
* library's "update to the new version". The new source is prepared first: only once
|
|
334
|
-
* it compiles is the running script stopped and the new one started
|
|
335
|
-
*
|
|
336
|
-
*
|
|
337
|
-
*
|
|
338
|
-
*
|
|
341
|
+
* it compiles is the running script stopped and the new one started. Until the new
|
|
342
|
+
* code's first run has landed, a failure — at compile time or at run time — puts the
|
|
343
|
+
* previous code back, with its input and prop values, and reports through `error`; the
|
|
344
|
+
* visuals on the chart are never dropped in between.
|
|
345
|
+
*
|
|
346
|
+
* An edited input or prop value survives where the new script still declares its key;
|
|
347
|
+
* a value still at its old declared default takes the NEW default, and anything else
|
|
348
|
+
* takes the new declaration default — all before the first run, so the new code
|
|
349
|
+
* computes once, with its final values.
|
|
350
|
+
*
|
|
351
|
+
* Resolves once the new code's first run has landed (`{ ok: true }`), or with
|
|
352
|
+
* `{ ok: false, error }` after a failure. A HIDDEN indicator resolves as soon as the
|
|
353
|
+
* source has compiled — it computes nothing until shown. An unchanged source resolves
|
|
354
|
+
* at once; a call superseded by a later one resolves with that later call's outcome.
|
|
355
|
+
* Never rejects; a native indicator resolves `ok: false`.
|
|
339
356
|
*/
|
|
340
|
-
updateCode(source: string):
|
|
357
|
+
updateCode(source: string): Promise<CodeUpdateResult>;
|
|
341
358
|
/**
|
|
342
359
|
* Hide or show the indicator. Hiding **suspends** it — its visuals are dropped (the legend
|
|
343
360
|
* row stays, marked hidden) and its computation stops (the engine session is torn down), so a
|
|
@@ -888,6 +905,21 @@ interface VelaEventMap extends Record<string, unknown> {
|
|
|
888
905
|
* leave the app theme alone.
|
|
889
906
|
*/
|
|
890
907
|
"theme:changed": VelaTheme;
|
|
908
|
+
/**
|
|
909
|
+
* The base price style is switching `from` → `to` (candles, line, area, a chart-type
|
|
910
|
+
* id, …). Fires synchronously BEFORE the chart repaints in the new style, whatever
|
|
911
|
+
* the path: the topbar style menu, `ctx.setPriceStyle`,
|
|
912
|
+
* `chart.renderer.set('priceStyle', …)`, the settings dialog, `applyConfig` and
|
|
913
|
+
* config templates, or a state restore. Never fires for the style the chart was
|
|
914
|
+
* created with, nor for a set to the style already shown. While it runs the chart
|
|
915
|
+
* still shows `from`, so a listener can capture the outgoing frame
|
|
916
|
+
* (`chart.renderer.screenshotCanvas()`) to animate the switch. Listeners must not
|
|
917
|
+
* change the price style again from inside it.
|
|
918
|
+
*/
|
|
919
|
+
"priceStyle:change": {
|
|
920
|
+
from: string;
|
|
921
|
+
to: string;
|
|
922
|
+
};
|
|
891
923
|
/** A study pane was reordered one slot (`dir`) — carries enough to invert for undo/redo. */
|
|
892
924
|
"pane:moved": {
|
|
893
925
|
paneId: string;
|
|
@@ -1872,6 +1904,26 @@ interface WidgetContext {
|
|
|
1872
1904
|
* `state:changed` + storage write follows). Only needed for state with no shell
|
|
1873
1905
|
* event of its own — indicator adds/removals already trigger the save cycle. */
|
|
1874
1906
|
stateChanged(): void;
|
|
1907
|
+
/** Where the right-click that opened a context menu landed. Set on the context handed
|
|
1908
|
+
* to `context:*` actions (`when` and `run`); absent everywhere else. */
|
|
1909
|
+
pointer?: ContextMenuPointer;
|
|
1910
|
+
}
|
|
1911
|
+
/**
|
|
1912
|
+
* What the chart's crosshair reported when a context menu opened ({@link WidgetContext.pointer}),
|
|
1913
|
+
* on the chart that received the right-click — in a workspace, the cell under the pointer.
|
|
1914
|
+
* Captured once at open: moving through the menu before picking a row does not change it.
|
|
1915
|
+
* The axis menus get what the crosshair reports over the axis: off the plot, `price` and
|
|
1916
|
+
* `paneKind` are null, while `time` still names the bar column under the pointer (on the
|
|
1917
|
+
* time axis, the bar above the click; null past the last bar).
|
|
1918
|
+
*/
|
|
1919
|
+
interface ContextMenuPointer {
|
|
1920
|
+
/** The value under the pointer on the pane it landed on: a price on the price pane, an
|
|
1921
|
+
* indicator value on a study pane (see `paneKind`). Null off the plot. */
|
|
1922
|
+
price: number | null;
|
|
1923
|
+
/** Open time of the bar under the pointer; null off the bars. */
|
|
1924
|
+
time: number | null;
|
|
1925
|
+
/** The kind of pane the pointer is on; null off the plot. */
|
|
1926
|
+
paneKind: 'price' | 'study' | null;
|
|
1875
1927
|
}
|
|
1876
1928
|
/** What {@link WidgetContext.addIndicator} takes: a named script, ready to run. */
|
|
1877
1929
|
interface ExternalIndicatorEntry {
|
|
@@ -1913,7 +1965,12 @@ interface WidgetActionDescriptor {
|
|
|
1913
1965
|
* one the flag is ignored (with a console warning) and the label renders. The piece
|
|
1914
1966
|
* that makes a `'screenshot'` slot override pixel-faithful to the native button. */
|
|
1915
1967
|
iconOnly?: boolean;
|
|
1916
|
-
/** Sort key
|
|
1968
|
+
/** Sort key (ascending; default 0; ties keep registration order). On the topbar it orders
|
|
1969
|
+
* the contributed group. In a context menu (`context:*`) contributed rows sort TOGETHER
|
|
1970
|
+
* with the menu's built-in rows, which sit at the ranks of `CONTEXT_MENU_BUILTIN_ORDER`:
|
|
1971
|
+
* the built-in actions below 0 and the settings row at 1000. So an action without
|
|
1972
|
+
* `order` lands after the built-in actions and before the settings row, `order: -100`
|
|
1973
|
+
* leads the menu, and on a tie the built-in row comes first. */
|
|
1917
1974
|
order?: number;
|
|
1918
1975
|
/** Topbar only: which cluster the button joins. `'right'` (default) is the
|
|
1919
1976
|
* right-hand tools cluster; `'left'` puts it with the PRIMARY chrome buttons —
|
|
@@ -1965,6 +2022,11 @@ interface SidePanelHeader {
|
|
|
1965
2022
|
/** Replace the header title (an empty string hides it). The topbar toggle keeps the
|
|
1966
2023
|
* DECLARED `title` as its tooltip. */
|
|
1967
2024
|
setTitle(title: string): void;
|
|
2025
|
+
/** Whether the panel covers every chart right now (see `maximizable`). */
|
|
2026
|
+
readonly maximized: boolean;
|
|
2027
|
+
/** Maximize the panel over the shell's charts, or restore it — what its header button
|
|
2028
|
+
* does. A no-op unless the descriptor is `maximizable`. Closing restores it too. */
|
|
2029
|
+
setMaximized(maximized: boolean): void;
|
|
1968
2030
|
}
|
|
1969
2031
|
/**
|
|
1970
2032
|
* A contributed SIDE PANEL — a docked column in the shell's panel dock, alongside the object
|
|
@@ -1996,6 +2058,10 @@ interface SidePanelDescriptor {
|
|
|
1996
2058
|
* column that shrinks the chart). For panels wide enough that a column would crush
|
|
1997
2059
|
* the plot. The dock stays exclusive either way. */
|
|
1998
2060
|
overlay?: boolean;
|
|
2061
|
+
/** A header button that maximizes the panel over every chart of the shell, and restores
|
|
2062
|
+
* it (default false). For panels that are sometimes the main work surface, like an
|
|
2063
|
+
* editor; the contribution can drive it too ({@link SidePanelHeader.setMaximized}). */
|
|
2064
|
+
maximizable?: boolean;
|
|
1999
2065
|
mount(ctx: WidgetContext, body: HTMLElement, header: SidePanelHeader): SidePanelHandle | void;
|
|
2000
2066
|
}
|
|
2001
2067
|
/** One panel toggle, as the shell's chrome consumes it (data, never DOM). */
|
|
@@ -2042,8 +2108,9 @@ declare function widgetActions(target: WidgetActionTarget, ctx?: WidgetContext):
|
|
|
2042
2108
|
interface LegendIndicatorInfo {
|
|
2043
2109
|
id: string;
|
|
2044
2110
|
title: string;
|
|
2045
|
-
/** The script source the indicator
|
|
2046
|
-
* (core-computed) indicator. The usual
|
|
2111
|
+
/** The script source the indicator runs NOW (read at click time, so an in-place code
|
|
2112
|
+
* update shows through); undefined for a NATIVE (core-computed) indicator. The usual
|
|
2113
|
+
* `when` gate for source-centric actions. */
|
|
2047
2114
|
source?: string;
|
|
2048
2115
|
}
|
|
2049
2116
|
/**
|
|
@@ -2222,4 +2289,4 @@ declare function unregisterDefaultEngine(language: string): void;
|
|
|
2222
2289
|
* language. The shell layers (widget, workspace cell) register exactly this result. */
|
|
2223
2290
|
declare function resolveEngines(overrides?: Record<string, EngineFactory>): Record<string, EngineFactory>;
|
|
2224
2291
|
|
|
2225
|
-
export { type
|
|
2292
|
+
export { type ScriptRunCause as $, type LegendIndicatorInfo as A, type BarsChangeReason as B, type CellStateContext as C, type DrawingsDocument as D, type ExternalIndicatorEntry as E, type FetchSeries as F, type NativeIndicatorContext as G, type NativeIndicatorDescriptor as H, type IndicatorHandle as I, type NativeIndicatorInfo as J, type NativeIndicatorOutput as K, type LegendActionDescriptor as L, MarksControl as M, type NativeIndicator as N, OVERRIDABLE_TOPBAR_IDS as O, type ParsedSymbol as P, type PreparedScript as Q, type ReplayState as R, type ScriptingEngine as S, RendererControl as T, ReplayControl as U, Vela as V, type WidgetContext as W, type ReplayEndReason as X, type ReplayStartOptions as Y, type RunIndicatorResult as Z, type SceneInspection as _, type ReplayBounds as a, type ScriptRunResult as a0, type SidePanelButton as a1, type SidePanelDescriptor as a2, type SidePanelHandle as a3, type SidePanelHeader as a4, type StatePersistenceHandler as a5, type StrategyFill as a6, type StrategyState as a7, type StrategyTrade as a8, type SymbolRankingHook as a9, unregisterLegendAction as aA, unregisterLegendCallout as aB, unregisterNativeIndicator as aC, unregisterSidePanel as aD, unregisterStatePersistence as aE, unregisterWidgetAction as aF, unregisterWidgetAttachment as aG, widgetActions as aH, widgetAttachments as aI, DEFAULT_PANEL_ORDER as aJ, TypedEventBus as aa, type VelaDeps as ab, type VisibleBarRange as ac, type WidgetActionDescriptor as ad, type WidgetActionTarget as ae, type WidgetAttachment as af, getNativeIndicator as ag, legendActions as ah, legendCallouts as ai, nativeIndicatorDescriptors as aj, nativeIndicatorTypes as ak, registerDefaultEngine as al, registerLegendAction as am, registerLegendCallout as an, registerNativeIndicator as ao, registerSidePanel as ap, registerStatePersistence as aq, registerSymbolRanking as ar, registerWidgetAction as as, registerWidgetAttachment as at, resolveEngines as au, sidePanels as av, statePersistenceHandlers as aw, symbolRanking as ax, topbarActionOverride as ay, unregisterDefaultEngine as az, type VelaEventMap as b, type ScriptRun as c, type Resolved as d, type ReplayTick as e, DataControl as f, type ReplayTickSource as g, type CodeUpdateResult as h, type ContextMenuPointer as i, type ContextSelect as j, DrawingsControl as k, type EngineAlert as l, type EngineCapabilities as m, type EngineContextSnapshot as n, type EngineFactory as o, type EngineWarning as p, type ExecutionHandlers as q, type ExecutionMarket as r, type ExecutionRequest as s, type ExecutionSession as t, type IndicatorEventMap as u, type IndicatorSummary as v, type LegendCalloutContent as w, type LegendCalloutDescriptor as x, type LegendCalloutItem as y, type LegendCalloutSpec as z };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { x as Millis, ao as InputSchema, am as IndicatorMeta, P as PriceStyle, O as OHLCV, I as InputValue, l as IndicatorModel, k as MoveTarget, aH as PaneAxis,
|
|
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 { x as Millis, ao as InputSchema, am as IndicatorMeta, P as PriceStyle, O as OHLCV, I as InputValue, l as IndicatorModel, k as MoveTarget, aH as PaneAxis, a_ as SeriesSpec, ak as Fill, H as Background, aQ as PriceLine, a7 as DrawingLine, a3 as DrawingBox, a6 as DrawingLabel, ab as DrawingPolyline, a8 as DrawingLinefill, ag as DrawingTable, h as IndicatorStatus, a as VisibleRange, c as VelaTheme, S as SerializedDrawing, z as DrawingTypeKey, y as SnapMode, a9 as DrawingMode, u as MarkClickEvent, e as IChartRenderer, R as RendererCapabilities, o as LegendActionView, p as LegendCalloutView, U as Unsubscribe, C as CrosshairEvent, r as ClickEvent, A as AxisLongPressEvent, v as DataWindowReadout, n as SymbolPickerFn, W as WallClock, bg as PaneInfo, aj as DrawingsOption, ad as DrawingSeriesGateway, D as Drawing, s as TimelineMark, t as MarkGroup, b as VelaOptions, F as AddIndicatorOptions, aG as MarketSwitch, E as MarketSnapshot, V as VisibleRangePreset, T as ThemeName } from './options-lMUwmRwh.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-oH78tYXL.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* A strategy's broker state at ONE bar — the flat summary a host reads while a script
|
|
@@ -292,6 +292,13 @@ interface IndicatorEventMap extends Record<string, unknown> {
|
|
|
292
292
|
time: number;
|
|
293
293
|
};
|
|
294
294
|
}
|
|
295
|
+
/** How a {@link IndicatorHandle.updateCode} call ended. Never a rejection. */
|
|
296
|
+
interface CodeUpdateResult {
|
|
297
|
+
/** The new code is the one running (or, hidden, the one that will run when shown). */
|
|
298
|
+
ok: boolean;
|
|
299
|
+
/** Why the update did not land — the previous code is running again. Null on success. */
|
|
300
|
+
error: Error | null;
|
|
301
|
+
}
|
|
295
302
|
/**
|
|
296
303
|
* What `chart.addIndicator(...)` returns to the developer. The handle is usable
|
|
297
304
|
* synchronously; data renders when execution resolves (see `on('ready')`).
|
|
@@ -331,13 +338,23 @@ interface IndicatorHandle {
|
|
|
331
338
|
* Replace the script and re-run it **in place** — same `id`, same legend row, same
|
|
332
339
|
* pane placement, same handle; the seam for a host editor's "run my edit" and for a
|
|
333
340
|
* library's "update to the new version". The new source is prepared first: only once
|
|
334
|
-
* it compiles is the running script stopped and the new one started
|
|
335
|
-
*
|
|
336
|
-
*
|
|
337
|
-
*
|
|
338
|
-
*
|
|
341
|
+
* it compiles is the running script stopped and the new one started. Until the new
|
|
342
|
+
* code's first run has landed, a failure — at compile time or at run time — puts the
|
|
343
|
+
* previous code back, with its input and prop values, and reports through `error`; the
|
|
344
|
+
* visuals on the chart are never dropped in between.
|
|
345
|
+
*
|
|
346
|
+
* An edited input or prop value survives where the new script still declares its key;
|
|
347
|
+
* a value still at its old declared default takes the NEW default, and anything else
|
|
348
|
+
* takes the new declaration default — all before the first run, so the new code
|
|
349
|
+
* computes once, with its final values.
|
|
350
|
+
*
|
|
351
|
+
* Resolves once the new code's first run has landed (`{ ok: true }`), or with
|
|
352
|
+
* `{ ok: false, error }` after a failure. A HIDDEN indicator resolves as soon as the
|
|
353
|
+
* source has compiled — it computes nothing until shown. An unchanged source resolves
|
|
354
|
+
* at once; a call superseded by a later one resolves with that later call's outcome.
|
|
355
|
+
* Never rejects; a native indicator resolves `ok: false`.
|
|
339
356
|
*/
|
|
340
|
-
updateCode(source: string):
|
|
357
|
+
updateCode(source: string): Promise<CodeUpdateResult>;
|
|
341
358
|
/**
|
|
342
359
|
* Hide or show the indicator. Hiding **suspends** it — its visuals are dropped (the legend
|
|
343
360
|
* row stays, marked hidden) and its computation stops (the engine session is torn down), so a
|
|
@@ -888,6 +905,21 @@ interface VelaEventMap extends Record<string, unknown> {
|
|
|
888
905
|
* leave the app theme alone.
|
|
889
906
|
*/
|
|
890
907
|
"theme:changed": VelaTheme;
|
|
908
|
+
/**
|
|
909
|
+
* The base price style is switching `from` → `to` (candles, line, area, a chart-type
|
|
910
|
+
* id, …). Fires synchronously BEFORE the chart repaints in the new style, whatever
|
|
911
|
+
* the path: the topbar style menu, `ctx.setPriceStyle`,
|
|
912
|
+
* `chart.renderer.set('priceStyle', …)`, the settings dialog, `applyConfig` and
|
|
913
|
+
* config templates, or a state restore. Never fires for the style the chart was
|
|
914
|
+
* created with, nor for a set to the style already shown. While it runs the chart
|
|
915
|
+
* still shows `from`, so a listener can capture the outgoing frame
|
|
916
|
+
* (`chart.renderer.screenshotCanvas()`) to animate the switch. Listeners must not
|
|
917
|
+
* change the price style again from inside it.
|
|
918
|
+
*/
|
|
919
|
+
"priceStyle:change": {
|
|
920
|
+
from: string;
|
|
921
|
+
to: string;
|
|
922
|
+
};
|
|
891
923
|
/** A study pane was reordered one slot (`dir`) — carries enough to invert for undo/redo. */
|
|
892
924
|
"pane:moved": {
|
|
893
925
|
paneId: string;
|
|
@@ -1872,6 +1904,26 @@ interface WidgetContext {
|
|
|
1872
1904
|
* `state:changed` + storage write follows). Only needed for state with no shell
|
|
1873
1905
|
* event of its own — indicator adds/removals already trigger the save cycle. */
|
|
1874
1906
|
stateChanged(): void;
|
|
1907
|
+
/** Where the right-click that opened a context menu landed. Set on the context handed
|
|
1908
|
+
* to `context:*` actions (`when` and `run`); absent everywhere else. */
|
|
1909
|
+
pointer?: ContextMenuPointer;
|
|
1910
|
+
}
|
|
1911
|
+
/**
|
|
1912
|
+
* What the chart's crosshair reported when a context menu opened ({@link WidgetContext.pointer}),
|
|
1913
|
+
* on the chart that received the right-click — in a workspace, the cell under the pointer.
|
|
1914
|
+
* Captured once at open: moving through the menu before picking a row does not change it.
|
|
1915
|
+
* The axis menus get what the crosshair reports over the axis: off the plot, `price` and
|
|
1916
|
+
* `paneKind` are null, while `time` still names the bar column under the pointer (on the
|
|
1917
|
+
* time axis, the bar above the click; null past the last bar).
|
|
1918
|
+
*/
|
|
1919
|
+
interface ContextMenuPointer {
|
|
1920
|
+
/** The value under the pointer on the pane it landed on: a price on the price pane, an
|
|
1921
|
+
* indicator value on a study pane (see `paneKind`). Null off the plot. */
|
|
1922
|
+
price: number | null;
|
|
1923
|
+
/** Open time of the bar under the pointer; null off the bars. */
|
|
1924
|
+
time: number | null;
|
|
1925
|
+
/** The kind of pane the pointer is on; null off the plot. */
|
|
1926
|
+
paneKind: 'price' | 'study' | null;
|
|
1875
1927
|
}
|
|
1876
1928
|
/** What {@link WidgetContext.addIndicator} takes: a named script, ready to run. */
|
|
1877
1929
|
interface ExternalIndicatorEntry {
|
|
@@ -1913,7 +1965,12 @@ interface WidgetActionDescriptor {
|
|
|
1913
1965
|
* one the flag is ignored (with a console warning) and the label renders. The piece
|
|
1914
1966
|
* that makes a `'screenshot'` slot override pixel-faithful to the native button. */
|
|
1915
1967
|
iconOnly?: boolean;
|
|
1916
|
-
/** Sort key
|
|
1968
|
+
/** Sort key (ascending; default 0; ties keep registration order). On the topbar it orders
|
|
1969
|
+
* the contributed group. In a context menu (`context:*`) contributed rows sort TOGETHER
|
|
1970
|
+
* with the menu's built-in rows, which sit at the ranks of `CONTEXT_MENU_BUILTIN_ORDER`:
|
|
1971
|
+
* the built-in actions below 0 and the settings row at 1000. So an action without
|
|
1972
|
+
* `order` lands after the built-in actions and before the settings row, `order: -100`
|
|
1973
|
+
* leads the menu, and on a tie the built-in row comes first. */
|
|
1917
1974
|
order?: number;
|
|
1918
1975
|
/** Topbar only: which cluster the button joins. `'right'` (default) is the
|
|
1919
1976
|
* right-hand tools cluster; `'left'` puts it with the PRIMARY chrome buttons —
|
|
@@ -1965,6 +2022,11 @@ interface SidePanelHeader {
|
|
|
1965
2022
|
/** Replace the header title (an empty string hides it). The topbar toggle keeps the
|
|
1966
2023
|
* DECLARED `title` as its tooltip. */
|
|
1967
2024
|
setTitle(title: string): void;
|
|
2025
|
+
/** Whether the panel covers every chart right now (see `maximizable`). */
|
|
2026
|
+
readonly maximized: boolean;
|
|
2027
|
+
/** Maximize the panel over the shell's charts, or restore it — what its header button
|
|
2028
|
+
* does. A no-op unless the descriptor is `maximizable`. Closing restores it too. */
|
|
2029
|
+
setMaximized(maximized: boolean): void;
|
|
1968
2030
|
}
|
|
1969
2031
|
/**
|
|
1970
2032
|
* A contributed SIDE PANEL — a docked column in the shell's panel dock, alongside the object
|
|
@@ -1996,6 +2058,10 @@ interface SidePanelDescriptor {
|
|
|
1996
2058
|
* column that shrinks the chart). For panels wide enough that a column would crush
|
|
1997
2059
|
* the plot. The dock stays exclusive either way. */
|
|
1998
2060
|
overlay?: boolean;
|
|
2061
|
+
/** A header button that maximizes the panel over every chart of the shell, and restores
|
|
2062
|
+
* it (default false). For panels that are sometimes the main work surface, like an
|
|
2063
|
+
* editor; the contribution can drive it too ({@link SidePanelHeader.setMaximized}). */
|
|
2064
|
+
maximizable?: boolean;
|
|
1999
2065
|
mount(ctx: WidgetContext, body: HTMLElement, header: SidePanelHeader): SidePanelHandle | void;
|
|
2000
2066
|
}
|
|
2001
2067
|
/** One panel toggle, as the shell's chrome consumes it (data, never DOM). */
|
|
@@ -2042,8 +2108,9 @@ declare function widgetActions(target: WidgetActionTarget, ctx?: WidgetContext):
|
|
|
2042
2108
|
interface LegendIndicatorInfo {
|
|
2043
2109
|
id: string;
|
|
2044
2110
|
title: string;
|
|
2045
|
-
/** The script source the indicator
|
|
2046
|
-
* (core-computed) indicator. The usual
|
|
2111
|
+
/** The script source the indicator runs NOW (read at click time, so an in-place code
|
|
2112
|
+
* update shows through); undefined for a NATIVE (core-computed) indicator. The usual
|
|
2113
|
+
* `when` gate for source-centric actions. */
|
|
2047
2114
|
source?: string;
|
|
2048
2115
|
}
|
|
2049
2116
|
/**
|
|
@@ -2222,4 +2289,4 @@ declare function unregisterDefaultEngine(language: string): void;
|
|
|
2222
2289
|
* language. The shell layers (widget, workspace cell) register exactly this result. */
|
|
2223
2290
|
declare function resolveEngines(overrides?: Record<string, EngineFactory>): Record<string, EngineFactory>;
|
|
2224
2291
|
|
|
2225
|
-
export { type
|
|
2292
|
+
export { type ScriptRunCause as $, type LegendIndicatorInfo as A, type BarsChangeReason as B, type CellStateContext as C, type DrawingsDocument as D, type ExternalIndicatorEntry as E, type FetchSeries as F, type NativeIndicatorContext as G, type NativeIndicatorDescriptor as H, type IndicatorHandle as I, type NativeIndicatorInfo as J, type NativeIndicatorOutput as K, type LegendActionDescriptor as L, MarksControl as M, type NativeIndicator as N, OVERRIDABLE_TOPBAR_IDS as O, type ParsedSymbol as P, type PreparedScript as Q, type ReplayState as R, type ScriptingEngine as S, RendererControl as T, ReplayControl as U, Vela as V, type WidgetContext as W, type ReplayEndReason as X, type ReplayStartOptions as Y, type RunIndicatorResult as Z, type SceneInspection as _, type ReplayBounds as a, type ScriptRunResult as a0, type SidePanelButton as a1, type SidePanelDescriptor as a2, type SidePanelHandle as a3, type SidePanelHeader as a4, type StatePersistenceHandler as a5, type StrategyFill as a6, type StrategyState as a7, type StrategyTrade as a8, type SymbolRankingHook as a9, unregisterLegendAction as aA, unregisterLegendCallout as aB, unregisterNativeIndicator as aC, unregisterSidePanel as aD, unregisterStatePersistence as aE, unregisterWidgetAction as aF, unregisterWidgetAttachment as aG, widgetActions as aH, widgetAttachments as aI, DEFAULT_PANEL_ORDER as aJ, TypedEventBus as aa, type VelaDeps as ab, type VisibleBarRange as ac, type WidgetActionDescriptor as ad, type WidgetActionTarget as ae, type WidgetAttachment as af, getNativeIndicator as ag, legendActions as ah, legendCallouts as ai, nativeIndicatorDescriptors as aj, nativeIndicatorTypes as ak, registerDefaultEngine as al, registerLegendAction as am, registerLegendCallout as an, registerNativeIndicator as ao, registerSidePanel as ap, registerStatePersistence as aq, registerSymbolRanking as ar, registerWidgetAction as as, registerWidgetAttachment as at, resolveEngines as au, sidePanels as av, statePersistenceHandlers as aw, symbolRanking as ax, topbarActionOverride as ay, unregisterDefaultEngine as az, type VelaEventMap as b, type ScriptRun as c, type Resolved as d, type ReplayTick as e, DataControl as f, type ReplayTickSource as g, type CodeUpdateResult as h, type ContextMenuPointer as i, type ContextSelect as j, DrawingsControl as k, type EngineAlert as l, type EngineCapabilities as m, type EngineContextSnapshot as n, type EngineFactory as o, type EngineWarning as p, type ExecutionHandlers as q, type ExecutionMarket as r, type ExecutionRequest as s, type ExecutionSession as t, type IndicatorEventMap as u, type IndicatorSummary as v, type LegendCalloutContent as w, type LegendCalloutDescriptor as x, type LegendCalloutItem as y, type LegendCalloutSpec as z };
|