@luxalgo/vela 0.8.5 → 0.9.1
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-DdqMxKdl.d.cts → DataProvider-B5i0_yY4.d.cts} +1 -1
- package/dist/{DataProvider-BUdlkx9I.d.ts → DataProvider-CPFgSyAm.d.ts} +1 -1
- package/dist/{chunk-QYIO37K7.js → chunk-3H6JO4VL.js} +2405 -1542
- package/dist/{chunk-BN4DNS3O.js → chunk-BLVL7WXF.js} +1156 -468
- package/dist/chunk-O6L27KRB.js +1331 -0
- package/dist/{chunk-WY5H4S4I.js → chunk-PZN4RS4T.js} +91 -36
- package/dist/{chunk-ALTGHKIM.js → chunk-Q7POFYNE.js} +516 -406
- package/dist/{chunk-AUOB7A5Y.js → chunk-WHPQQYH7.js} +29 -13
- package/dist/{contributions-D8xuYc9U.d.cts → contributions-BfBaF6eE.d.ts} +71 -22
- package/dist/{contributions-P9fBBuY1.d.ts → contributions-DupwEkzc.d.cts} +71 -22
- package/dist/index.cjs +4040 -2087
- package/dist/index.d.cts +53 -25
- package/dist/index.d.ts +53 -25
- package/dist/index.js +5 -5
- package/dist/{keymap-CGOz5F5f.d.cts → keymap-C48ughm6.d.ts} +9 -6
- package/dist/{keymap-CGOz5F5f.d.ts → keymap-W0hiajU6.d.cts} +9 -6
- package/dist/locales/ar.cjs +2262 -0
- package/dist/locales/ar.d.cts +5 -0
- package/dist/locales/ar.d.ts +5 -0
- package/dist/locales/ar.js +2260 -0
- package/dist/locales/de.cjs +2262 -0
- package/dist/locales/de.d.cts +5 -0
- package/dist/locales/de.d.ts +5 -0
- package/dist/locales/de.js +2260 -0
- package/dist/locales/en.cjs +2262 -0
- package/dist/locales/en.d.cts +5 -0
- package/dist/locales/en.d.ts +5 -0
- package/dist/locales/en.js +2260 -0
- package/dist/locales/es.cjs +2262 -0
- package/dist/locales/es.d.cts +5 -0
- package/dist/locales/es.d.ts +5 -0
- package/dist/locales/es.js +2260 -0
- package/dist/locales/fr.cjs +2262 -0
- package/dist/locales/fr.d.cts +5 -0
- package/dist/locales/fr.d.ts +5 -0
- package/dist/locales/fr.js +2260 -0
- package/dist/locales/he.cjs +2262 -0
- package/dist/locales/he.d.cts +5 -0
- package/dist/locales/he.d.ts +5 -0
- package/dist/locales/he.js +2260 -0
- package/dist/locales/hi.cjs +2262 -0
- package/dist/locales/hi.d.cts +5 -0
- package/dist/locales/hi.d.ts +5 -0
- package/dist/locales/hi.js +2260 -0
- package/dist/locales/id.cjs +2262 -0
- package/dist/locales/id.d.cts +5 -0
- package/dist/locales/id.d.ts +5 -0
- package/dist/locales/id.js +2260 -0
- package/dist/locales/it.cjs +2262 -0
- package/dist/locales/it.d.cts +5 -0
- package/dist/locales/it.d.ts +5 -0
- package/dist/locales/it.js +2260 -0
- package/dist/locales/ja.cjs +2262 -0
- package/dist/locales/ja.d.cts +5 -0
- package/dist/locales/ja.d.ts +5 -0
- package/dist/locales/ja.js +2260 -0
- package/dist/locales/ko.cjs +2262 -0
- package/dist/locales/ko.d.cts +5 -0
- package/dist/locales/ko.d.ts +5 -0
- package/dist/locales/ko.js +2260 -0
- package/dist/locales/ms.cjs +2262 -0
- package/dist/locales/ms.d.cts +5 -0
- package/dist/locales/ms.d.ts +5 -0
- package/dist/locales/ms.js +2260 -0
- package/dist/locales/pl.cjs +2262 -0
- package/dist/locales/pl.d.cts +5 -0
- package/dist/locales/pl.d.ts +5 -0
- package/dist/locales/pl.js +2260 -0
- package/dist/locales/pt-BR.cjs +2262 -0
- package/dist/locales/pt-BR.d.cts +5 -0
- package/dist/locales/pt-BR.d.ts +5 -0
- package/dist/locales/pt-BR.js +2260 -0
- package/dist/locales/ru.cjs +2262 -0
- package/dist/locales/ru.d.cts +5 -0
- package/dist/locales/ru.d.ts +5 -0
- package/dist/locales/ru.js +2260 -0
- package/dist/locales/th.cjs +2262 -0
- package/dist/locales/th.d.cts +5 -0
- package/dist/locales/th.d.ts +5 -0
- package/dist/locales/th.js +2260 -0
- package/dist/locales/tr.cjs +2262 -0
- package/dist/locales/tr.d.cts +5 -0
- package/dist/locales/tr.d.ts +5 -0
- package/dist/locales/tr.js +2260 -0
- package/dist/locales/vi.cjs +2262 -0
- package/dist/locales/vi.d.cts +5 -0
- package/dist/locales/vi.d.ts +5 -0
- package/dist/locales/vi.js +2260 -0
- package/dist/locales/zh-Hans.cjs +2262 -0
- package/dist/locales/zh-Hans.d.cts +5 -0
- package/dist/locales/zh-Hans.d.ts +5 -0
- package/dist/locales/zh-Hans.js +2260 -0
- package/dist/locales/zh-Hant.cjs +2262 -0
- package/dist/locales/zh-Hant.d.cts +5 -0
- package/dist/locales/zh-Hant.d.ts +5 -0
- package/dist/locales/zh-Hant.js +2260 -0
- package/dist/{options-BI5Tp32b.d.ts → options-B7aL1pbf.d.ts} +74 -9
- package/dist/{options-BI5Tp32b.d.cts → options-I1H2HDWw.d.cts} +74 -9
- package/dist/{plugin-B8F1nor8.d.cts → plugin-BGz-Vsdv.d.cts} +81 -35
- package/dist/{plugin-D5Z-Q6TX.d.ts → plugin-BZHypj8h.d.ts} +81 -35
- package/dist/plugin.cjs +1268 -319
- package/dist/plugin.d.cts +7 -6
- package/dist/plugin.d.ts +7 -6
- package/dist/plugin.js +3 -3
- package/dist/providers/binance.cjs +1 -1
- package/dist/providers/binance.d.cts +3 -2
- package/dist/providers/binance.d.ts +3 -2
- package/dist/providers/binance.js +1 -1
- package/dist/providers/coinbase.cjs +1 -1
- package/dist/providers/coinbase.d.cts +3 -2
- package/dist/providers/coinbase.d.ts +3 -2
- package/dist/providers/coinbase.js +1 -1
- package/dist/providers/hyperliquid.cjs +1 -1
- package/dist/providers/hyperliquid.d.cts +3 -2
- package/dist/providers/hyperliquid.d.ts +3 -2
- package/dist/providers/hyperliquid.js +1 -1
- package/dist/{side-panel-_2UK1gSm.d.ts → side-panel-BEQJqSjR.d.cts} +14 -2
- package/dist/{side-panel-_2UK1gSm.d.cts → side-panel-Ud0SBAnE.d.ts} +14 -2
- package/dist/{statusline-model-CTwtDIca.d.cts → statusline-model-Dfb_GD9u.d.ts} +14 -3
- package/dist/{statusline-model-D9kWC9X5.d.ts → statusline-model-PHt0YhmI.d.cts} +14 -3
- package/dist/types-Bwf63xGI.d.cts +2518 -0
- package/dist/types-Bwf63xGI.d.ts +2518 -0
- package/dist/ui.cjs +1008 -56
- package/dist/ui.d.cts +21 -2
- package/dist/ui.d.ts +21 -2
- package/dist/ui.js +3 -3
- package/dist/vela.global.js +4005 -2054
- package/dist/vela.global.min.js +57 -57
- package/dist/widget.cjs +5384 -2698
- package/dist/widget.d.cts +100 -26
- package/dist/widget.d.ts +100 -26
- package/dist/widget.js +19 -11
- package/dist/workspace.cjs +5373 -2705
- package/dist/workspace.d.cts +63 -15
- package/dist/workspace.d.ts +63 -15
- package/dist/workspace.js +6 -6
- package/package.json +9 -2
- package/dist/chunk-I2U4NZD2.js +0 -340
- /package/dist/{chunk-W5YPYZ2P.js → chunk-3EYCX2L4.js} +0 -0
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { M as MessageLike, T as Translator, m as TextDirection, b as LocalizationOptions } from './types-Bwf63xGI.js';
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* Canonical time in Vela: Unix epoch **milliseconds**.
|
|
3
5
|
*
|
|
@@ -86,7 +88,11 @@ interface SeriesDisplay {
|
|
|
86
88
|
interface SeriesBase {
|
|
87
89
|
/** Content-addressed, stable across re-runs of identical source (see identity.ts). */
|
|
88
90
|
id: string;
|
|
91
|
+
/** The series' name: its identity for engines and hosts (output keys, series ids). */
|
|
89
92
|
title: string;
|
|
93
|
+
/** What the legend, the data window and the settings show instead of {@link title}, in
|
|
94
|
+
* the chart's language. Absent ⇒ {@link title}. */
|
|
95
|
+
displayTitle?: MessageLike;
|
|
90
96
|
/** Pane this series belongs to; resolved by the orchestrator. */
|
|
91
97
|
paneId: string;
|
|
92
98
|
/** Declared draw-order intent; the renderer owns final z-ordering. */
|
|
@@ -381,6 +387,8 @@ interface PriceLine {
|
|
|
381
387
|
lineStyle?: LineStyle;
|
|
382
388
|
width?: number;
|
|
383
389
|
title?: string;
|
|
390
|
+
/** {@link title} in the chart's language. Absent ⇒ {@link title}. */
|
|
391
|
+
displayTitle?: MessageLike;
|
|
384
392
|
}
|
|
385
393
|
/**
|
|
386
394
|
* The renderer-neutral, full description of what to draw. In the engine-owned
|
|
@@ -436,8 +444,26 @@ interface TradeExecution {
|
|
|
436
444
|
* declarations onto this at its boundary). Drives the renderer's settings dialog
|
|
437
445
|
* (the gear settings UI).
|
|
438
446
|
*/
|
|
447
|
+
|
|
439
448
|
type InputType = 'int' | 'float' | 'bool' | 'string' | 'source' | 'color' | 'price' | 'time' | 'session' | 'timeframe' | 'symbol' | 'text_area';
|
|
440
449
|
type InputValue = number | string | boolean;
|
|
450
|
+
/**
|
|
451
|
+
* The display side of an input: what the settings dialog and the legend SHOW, in the
|
|
452
|
+
* chart's language. The input's own `title`, `group` and `options` stay what they are
|
|
453
|
+
* (a script reads them, layouts persist the option values), and this side-car only
|
|
454
|
+
* changes how they read. Each field is optional and falls back to the identity field.
|
|
455
|
+
*/
|
|
456
|
+
interface InputDisplay {
|
|
457
|
+
/** Shown instead of `title`. */
|
|
458
|
+
title?: MessageLike;
|
|
459
|
+
/** Shown instead of `tooltip`. */
|
|
460
|
+
tooltip?: MessageLike;
|
|
461
|
+
/** Shown instead of `group` as the section heading. */
|
|
462
|
+
group?: MessageLike;
|
|
463
|
+
/** Shown label per stored option value (`'Close'` → a translated "Close"). Values
|
|
464
|
+
* without an entry show as themselves. */
|
|
465
|
+
options?: Readonly<Record<string, MessageLike>>;
|
|
466
|
+
}
|
|
441
467
|
/**
|
|
442
468
|
* Host-provided symbol picker for the settings dialog's `input.symbol` control. Called when the
|
|
443
469
|
* user activates the field: the host opens its own symbol-selection UI (e.g. the app's ticker
|
|
@@ -483,6 +509,8 @@ interface InputSchema {
|
|
|
483
509
|
* `inline=` row show while ANY member's gate passes. A hidden input keeps its value. */
|
|
484
510
|
when?: InputWhen;
|
|
485
511
|
tooltip?: string;
|
|
512
|
+
/** Translatable display text for this input (see {@link InputDisplay}). */
|
|
513
|
+
display?: InputDisplay;
|
|
486
514
|
}
|
|
487
515
|
/**
|
|
488
516
|
* The DELTAS of a value bag against its schema's declaration defaults — what state
|
|
@@ -528,6 +556,11 @@ interface IndicatorModel {
|
|
|
528
556
|
* `indicator(..., shorttitle=)`.
|
|
529
557
|
*/
|
|
530
558
|
shorttitle?: string;
|
|
559
|
+
/** What the chart SHOWS for {@link title}, in its language (a native indicator's
|
|
560
|
+
* translatable name). Absent ⇒ {@link title}. */
|
|
561
|
+
displayTitle?: MessageLike;
|
|
562
|
+
/** What the chart shows for {@link shorttitle}. Absent ⇒ {@link shorttitle}. */
|
|
563
|
+
displayShorttitle?: MessageLike;
|
|
531
564
|
overlay: boolean;
|
|
532
565
|
paneHint: PaneHint;
|
|
533
566
|
/**
|
|
@@ -891,11 +924,13 @@ interface DrawingText {
|
|
|
891
924
|
* renderer's settings popup builds controls generically — adding a new drawing
|
|
892
925
|
* type is a schema entry, not new UI code.
|
|
893
926
|
*/
|
|
927
|
+
|
|
894
928
|
type FieldKind = 'color' | 'number' | 'select' | 'lineStyle' | 'boolean' | 'text' | 'opacity';
|
|
895
929
|
interface SettingsField {
|
|
896
930
|
/** Dot-path into the drawing, e.g. `'style.lineColor'`, `'text.value'`, `'locked'`. */
|
|
897
931
|
path: string;
|
|
898
|
-
|
|
932
|
+
/** What the settings show; a message reads in the chart's language. */
|
|
933
|
+
label: MessageLike;
|
|
899
934
|
kind: FieldKind;
|
|
900
935
|
/** number/opacity bounds. */
|
|
901
936
|
min?: number;
|
|
@@ -904,7 +939,7 @@ interface SettingsField {
|
|
|
904
939
|
/** select options. */
|
|
905
940
|
options?: ReadonlyArray<{
|
|
906
941
|
value: string;
|
|
907
|
-
label:
|
|
942
|
+
label: MessageLike;
|
|
908
943
|
}>;
|
|
909
944
|
/** Cosmetic grouping in the popup. */
|
|
910
945
|
group?: 'line' | 'fill' | 'text' | 'behavior';
|
|
@@ -914,6 +949,10 @@ interface SettingsField {
|
|
|
914
949
|
path: string;
|
|
915
950
|
in: readonly unknown[];
|
|
916
951
|
};
|
|
952
|
+
/** The label of the one row this field shares with the next one: a color and its line
|
|
953
|
+
* style ("Midline" for "Midline color" + "Midline style"), or an upper and a lower color
|
|
954
|
+
* ("Bands"). */
|
|
955
|
+
rowLabel?: MessageLike;
|
|
917
956
|
}
|
|
918
957
|
interface SettingsSchema {
|
|
919
958
|
fields: SettingsField[];
|
|
@@ -1046,6 +1085,10 @@ declare abstract class Drawing {
|
|
|
1046
1085
|
max: number;
|
|
1047
1086
|
} | null;
|
|
1048
1087
|
abstract schema(): SettingsSchema;
|
|
1088
|
+
/** The text a fresh drawing of this type starts with ("Note", "Callout"), as a message,
|
|
1089
|
+
* or null for a type that seeds none. A new drawing stores its English source; the chart
|
|
1090
|
+
* that places one interactively writes it in its own language instead. */
|
|
1091
|
+
placeholderText(): MessageLike | null;
|
|
1049
1092
|
/**
|
|
1050
1093
|
* Editable per-level config for a rich "gear" settings panel (Fibonacci levels):
|
|
1051
1094
|
* each entry's `color` / `enabled` / `label` is mutated via a `levels.<i>.<field>`
|
|
@@ -1076,6 +1119,7 @@ declare abstract class Drawing {
|
|
|
1076
1119
|
*/
|
|
1077
1120
|
interface ToolDefinition {
|
|
1078
1121
|
type: DrawingTypeKey;
|
|
1122
|
+
/** The tool's name, in the language the definition was built for. */
|
|
1079
1123
|
label: string;
|
|
1080
1124
|
/** Inline SVG markup (no DOM). */
|
|
1081
1125
|
icon: string;
|
|
@@ -1098,7 +1142,8 @@ interface ToolbarDefinition {
|
|
|
1098
1142
|
/** A developer-supplied explicit group (just type keys; the registry fills the rest). */
|
|
1099
1143
|
interface ToolbarGroupConfig {
|
|
1100
1144
|
id: string;
|
|
1101
|
-
|
|
1145
|
+
/** The group's name; a message (`msg()`) reads in the chart's language. */
|
|
1146
|
+
label: MessageLike;
|
|
1102
1147
|
tools: DrawingTypeKey[];
|
|
1103
1148
|
}
|
|
1104
1149
|
/** Public `options.drawings` shape. `true` = default toolbar; object = customize. */
|
|
@@ -1107,14 +1152,15 @@ type DrawingsOption = boolean | {
|
|
|
1107
1152
|
tools?: DrawingTypeKey[];
|
|
1108
1153
|
groups?: ToolbarGroupConfig[];
|
|
1109
1154
|
};
|
|
1110
|
-
/** The default toolbar — every registered type, grouped into the canonical seven-button
|
|
1111
|
-
|
|
1155
|
+
/** The default toolbar — every registered type, grouped into the canonical seven-button
|
|
1156
|
+
* layout, labelled in `i18n`'s language (English without one). */
|
|
1157
|
+
declare function defaultToolbar(i18n?: Translator | null): ToolbarDefinition;
|
|
1112
1158
|
/**
|
|
1113
1159
|
* Resolve `options.drawings` into a concrete toolbar definition + initial visibility.
|
|
1114
1160
|
* Default (undefined) ⇒ toolbar VISIBLE; `false` ⇒ subsystem available but toolbar hidden
|
|
1115
1161
|
* (headless use still works via `chart.drawings.add(...)`); object ⇒ `toolbar ?? true`.
|
|
1116
1162
|
*/
|
|
1117
|
-
declare function buildToolbar(option: DrawingsOption | undefined): {
|
|
1163
|
+
declare function buildToolbar(option: DrawingsOption | undefined, i18n?: Translator | null): {
|
|
1118
1164
|
definition: ToolbarDefinition;
|
|
1119
1165
|
visible: boolean;
|
|
1120
1166
|
};
|
|
@@ -1133,7 +1179,10 @@ interface DrawingToolDefaults {
|
|
|
1133
1179
|
/** A named, saved look for one tool (a "style"): applied, it sets the same settings a
|
|
1134
1180
|
* remembered default does — style, text styling and per-type settings. */
|
|
1135
1181
|
interface DrawingToolTemplate {
|
|
1182
|
+
/** The style's name: its identity among the tool's styles. */
|
|
1136
1183
|
name: string;
|
|
1184
|
+
/** What a built-in style's name reads as in the chart's language. Absent ⇒ {@link name}. */
|
|
1185
|
+
label?: MessageLike;
|
|
1137
1186
|
settings: DrawingToolDefaults;
|
|
1138
1187
|
}
|
|
1139
1188
|
|
|
@@ -1412,6 +1461,11 @@ interface MarkClickEvent {
|
|
|
1412
1461
|
group?: string;
|
|
1413
1462
|
}
|
|
1414
1463
|
|
|
1464
|
+
/** The language and direction attributes of a renderer's root element (`null` = unset). */
|
|
1465
|
+
interface RendererRootAttributes {
|
|
1466
|
+
lang: string | null;
|
|
1467
|
+
dir: TextDirection | null;
|
|
1468
|
+
}
|
|
1415
1469
|
/** What a rendering backend supports — drives graceful degradation + warnings. */
|
|
1416
1470
|
interface RendererCapabilities {
|
|
1417
1471
|
panes: boolean;
|
|
@@ -1635,6 +1689,14 @@ interface IChartRenderer {
|
|
|
1635
1689
|
readFeature(key: string): unknown;
|
|
1636
1690
|
mount(container: HTMLElement, theme: VelaTheme): void;
|
|
1637
1691
|
setTheme(theme: VelaTheme): void;
|
|
1692
|
+
/**
|
|
1693
|
+
* Adopt the chart's localization: render text through `i18n` and numbers and dates
|
|
1694
|
+
* through `i18n.format`, then repaint. Called once after `mount` and again after every
|
|
1695
|
+
* `chart.setLocale`. `lang` and `dir` are what the renderer's root element should carry
|
|
1696
|
+
* (`null` = leave the attribute alone, the host page decides). Optional: a renderer
|
|
1697
|
+
* without it keeps English text and formatting.
|
|
1698
|
+
*/
|
|
1699
|
+
setLocalization?(i18n: Translator, root: RendererRootAttributes): void;
|
|
1638
1700
|
resize(): void;
|
|
1639
1701
|
destroy(): void;
|
|
1640
1702
|
/**
|
|
@@ -1895,7 +1957,7 @@ interface IChartRenderer {
|
|
|
1895
1957
|
/** Host-app settings tabs (callback rows) shown by the renderer's settings dialog.
|
|
1896
1958
|
* `id` names a section for the visibility policy (defaults to the title's slug). */
|
|
1897
1959
|
setSettingsSections?(sections: ReadonlyArray<{
|
|
1898
|
-
title:
|
|
1960
|
+
title: MessageLike;
|
|
1899
1961
|
rows: readonly unknown[];
|
|
1900
1962
|
id?: string;
|
|
1901
1963
|
}>): void;
|
|
@@ -2013,7 +2075,10 @@ type ThemeName = 'dark' | 'light';
|
|
|
2013
2075
|
* Built-in default: `NativeRenderer`.
|
|
2014
2076
|
* from `'vela/renderers/lwc'` and pass it as `options.renderer`. */
|
|
2015
2077
|
type RendererConstructor = new (opts?: RendererDisplayOptions) => IChartRenderer;
|
|
2016
|
-
|
|
2078
|
+
/** The chart's options. Its {@link LocalizationOptions} (`locale`, `direction`, `messages`,
|
|
2079
|
+
* `numberingSystem`, `hourCycle`, `weekStart`, `formatters`) change at runtime through
|
|
2080
|
+
* `chart.setLocale`. */
|
|
2081
|
+
interface VelaOptions extends MarketConfig, LocalizationOptions {
|
|
2017
2082
|
/** false = static history; true = history + live forming candle. */
|
|
2018
2083
|
live?: boolean;
|
|
2019
2084
|
theme?: ThemeName | VelaTheme;
|
|
@@ -2268,4 +2333,4 @@ interface AddIndicatorOptions {
|
|
|
2268
2333
|
title?: string;
|
|
2269
2334
|
}
|
|
2270
2335
|
|
|
2271
|
-
export { type
|
|
2336
|
+
export { type CandleStyle as $, type AxisLongPressEvent as A, type DrawingTypeKey as B, type CrosshairEvent as C, Drawing as D, type ToolbarDefinition as E, type MarketSnapshot as F, type AddIndicatorOptions as G, type AnimationConfig as H, type InputValue as I, type Background as J, type BoxFontFamily as K, type LineStyle as L, type MarketConfig as M, type NativeBackend as N, type OHLCV as O, type PriceStyle as P, type BoxHAlign as Q, type RendererCapabilities as R, type SerializedDrawing as S, type ThemeName as T, type Unsubscribe as U, type VisibleRangePreset as V, type WallClock as W, type BoxTextSize as X, type BoxVAlign as Y, type CandleBarColor as Z, type CandleSeries as _, type VisibleRange as a, type SeriesPoint as a$, type DataWindowGroup as a0, type DataWindowOHLC as a1, type DataWindowRow as a2, type DirtyRange as a3, type DrawingBox as a4, type DrawingExtend as a5, type DrawingIntent as a6, type DrawingLabel as a7, type DrawingLine as a8, type DrawingLinefill as a9, type LineLikeStyle as aA, type MarkContent as aB, type MarkContentSource as aC, type MarkGlyph as aD, type MarkPanelItem as aE, type MarkShape as aF, type MarkerPoint as aG, type MarkerSeries as aH, type MarketSwitch as aI, type PaneAxis as aJ, type PaneAxisBand as aK, type PaneHint as aL, type PaneKind as aM, type PolylinePoint as aN, type PriceAxisOptions as aO, type PriceAxisTick as aP, type PriceAxisTickContext as aQ, type PriceAxisTicksFn as aR, type PriceLine as aS, type Projector as aT, type ProviderName as aU, type RendererConstructor as aV, type Scene as aW, type SchemaPatch as aX, SecondClock as aY, type SeriesDisplay as aZ, type SeriesKind as a_, type DrawingMode as aa, type DrawingPoint as ab, type DrawingPolyline as ac, type DrawingSeriesBar as ad, type DrawingSeriesGateway as ae, type DrawingSeriesState as af, type DrawingStyle as ag, type DrawingTable as ah, type DrawingText as ai, type DrawingXLoc as aj, type DrawingsOption as ak, type Fill as al, type FillGradientStop as am, type IndicatorMeta as an, type InputCondition as ao, type InputDisplay as ap, type InputSchema as aq, type InputType as ar, type InputWhen as as, type IntroAnimation as at, type IntroConfig as au, type IntroStyle as av, type LabelStyle as aw, type LabelYLoc as ax, type LineLikeKind as ay, type LineLikeSeries as az, type VelaOptions as b, type SeriesSpec as b0, type SeriesSurface as b1, type SeriesValueDelta as b2, type SettingsField as b3, type SettingsSchema as b4, type SettingsVisibilityPolicy as b5, type TableCell as b6, type TableMerge as b7, type TablePosition as b8, type ToolbarGroupConfig as b9, type TradeExecution as ba, type ValuePatch as bb, buildToolbar as bc, defaultToolbar as bd, inputDeltas as be, inputVisible as bf, seriesInScale as bg, seriesShownOn as bh, type PaneInfo as bi, type DrawingToolDefaults as bj, type DrawingToolTemplate as bk, type VelaTheme as c, type MarketSession as d, type IChartRenderer as e, type RendererDisplayOptions as f, type IndicatorRenderHandle as g, type IndicatorStatus as h, type RendererRootAttributes as i, type Pane as j, type PaneAction as k, type MoveTarget as l, type IndicatorModel as m, type ScenePatch as n, type SymbolPickerFn as o, type LegendActionView as p, type LegendCalloutView as q, type InputChangeEvent as r, type ClickEvent as s, type TimelineMark as t, type MarkGroup as u, type MarkClickEvent as v, type DataWindowReadout as w, type IDrawingsRendererPort as x, type Millis as y, type SnapMode as z };
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { M as MessageLike, T as Translator, m as TextDirection, b as LocalizationOptions } from './types-Bwf63xGI.cjs';
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* Canonical time in Vela: Unix epoch **milliseconds**.
|
|
3
5
|
*
|
|
@@ -86,7 +88,11 @@ interface SeriesDisplay {
|
|
|
86
88
|
interface SeriesBase {
|
|
87
89
|
/** Content-addressed, stable across re-runs of identical source (see identity.ts). */
|
|
88
90
|
id: string;
|
|
91
|
+
/** The series' name: its identity for engines and hosts (output keys, series ids). */
|
|
89
92
|
title: string;
|
|
93
|
+
/** What the legend, the data window and the settings show instead of {@link title}, in
|
|
94
|
+
* the chart's language. Absent ⇒ {@link title}. */
|
|
95
|
+
displayTitle?: MessageLike;
|
|
90
96
|
/** Pane this series belongs to; resolved by the orchestrator. */
|
|
91
97
|
paneId: string;
|
|
92
98
|
/** Declared draw-order intent; the renderer owns final z-ordering. */
|
|
@@ -381,6 +387,8 @@ interface PriceLine {
|
|
|
381
387
|
lineStyle?: LineStyle;
|
|
382
388
|
width?: number;
|
|
383
389
|
title?: string;
|
|
390
|
+
/** {@link title} in the chart's language. Absent ⇒ {@link title}. */
|
|
391
|
+
displayTitle?: MessageLike;
|
|
384
392
|
}
|
|
385
393
|
/**
|
|
386
394
|
* The renderer-neutral, full description of what to draw. In the engine-owned
|
|
@@ -436,8 +444,26 @@ interface TradeExecution {
|
|
|
436
444
|
* declarations onto this at its boundary). Drives the renderer's settings dialog
|
|
437
445
|
* (the gear settings UI).
|
|
438
446
|
*/
|
|
447
|
+
|
|
439
448
|
type InputType = 'int' | 'float' | 'bool' | 'string' | 'source' | 'color' | 'price' | 'time' | 'session' | 'timeframe' | 'symbol' | 'text_area';
|
|
440
449
|
type InputValue = number | string | boolean;
|
|
450
|
+
/**
|
|
451
|
+
* The display side of an input: what the settings dialog and the legend SHOW, in the
|
|
452
|
+
* chart's language. The input's own `title`, `group` and `options` stay what they are
|
|
453
|
+
* (a script reads them, layouts persist the option values), and this side-car only
|
|
454
|
+
* changes how they read. Each field is optional and falls back to the identity field.
|
|
455
|
+
*/
|
|
456
|
+
interface InputDisplay {
|
|
457
|
+
/** Shown instead of `title`. */
|
|
458
|
+
title?: MessageLike;
|
|
459
|
+
/** Shown instead of `tooltip`. */
|
|
460
|
+
tooltip?: MessageLike;
|
|
461
|
+
/** Shown instead of `group` as the section heading. */
|
|
462
|
+
group?: MessageLike;
|
|
463
|
+
/** Shown label per stored option value (`'Close'` → a translated "Close"). Values
|
|
464
|
+
* without an entry show as themselves. */
|
|
465
|
+
options?: Readonly<Record<string, MessageLike>>;
|
|
466
|
+
}
|
|
441
467
|
/**
|
|
442
468
|
* Host-provided symbol picker for the settings dialog's `input.symbol` control. Called when the
|
|
443
469
|
* user activates the field: the host opens its own symbol-selection UI (e.g. the app's ticker
|
|
@@ -483,6 +509,8 @@ interface InputSchema {
|
|
|
483
509
|
* `inline=` row show while ANY member's gate passes. A hidden input keeps its value. */
|
|
484
510
|
when?: InputWhen;
|
|
485
511
|
tooltip?: string;
|
|
512
|
+
/** Translatable display text for this input (see {@link InputDisplay}). */
|
|
513
|
+
display?: InputDisplay;
|
|
486
514
|
}
|
|
487
515
|
/**
|
|
488
516
|
* The DELTAS of a value bag against its schema's declaration defaults — what state
|
|
@@ -528,6 +556,11 @@ interface IndicatorModel {
|
|
|
528
556
|
* `indicator(..., shorttitle=)`.
|
|
529
557
|
*/
|
|
530
558
|
shorttitle?: string;
|
|
559
|
+
/** What the chart SHOWS for {@link title}, in its language (a native indicator's
|
|
560
|
+
* translatable name). Absent ⇒ {@link title}. */
|
|
561
|
+
displayTitle?: MessageLike;
|
|
562
|
+
/** What the chart shows for {@link shorttitle}. Absent ⇒ {@link shorttitle}. */
|
|
563
|
+
displayShorttitle?: MessageLike;
|
|
531
564
|
overlay: boolean;
|
|
532
565
|
paneHint: PaneHint;
|
|
533
566
|
/**
|
|
@@ -891,11 +924,13 @@ interface DrawingText {
|
|
|
891
924
|
* renderer's settings popup builds controls generically — adding a new drawing
|
|
892
925
|
* type is a schema entry, not new UI code.
|
|
893
926
|
*/
|
|
927
|
+
|
|
894
928
|
type FieldKind = 'color' | 'number' | 'select' | 'lineStyle' | 'boolean' | 'text' | 'opacity';
|
|
895
929
|
interface SettingsField {
|
|
896
930
|
/** Dot-path into the drawing, e.g. `'style.lineColor'`, `'text.value'`, `'locked'`. */
|
|
897
931
|
path: string;
|
|
898
|
-
|
|
932
|
+
/** What the settings show; a message reads in the chart's language. */
|
|
933
|
+
label: MessageLike;
|
|
899
934
|
kind: FieldKind;
|
|
900
935
|
/** number/opacity bounds. */
|
|
901
936
|
min?: number;
|
|
@@ -904,7 +939,7 @@ interface SettingsField {
|
|
|
904
939
|
/** select options. */
|
|
905
940
|
options?: ReadonlyArray<{
|
|
906
941
|
value: string;
|
|
907
|
-
label:
|
|
942
|
+
label: MessageLike;
|
|
908
943
|
}>;
|
|
909
944
|
/** Cosmetic grouping in the popup. */
|
|
910
945
|
group?: 'line' | 'fill' | 'text' | 'behavior';
|
|
@@ -914,6 +949,10 @@ interface SettingsField {
|
|
|
914
949
|
path: string;
|
|
915
950
|
in: readonly unknown[];
|
|
916
951
|
};
|
|
952
|
+
/** The label of the one row this field shares with the next one: a color and its line
|
|
953
|
+
* style ("Midline" for "Midline color" + "Midline style"), or an upper and a lower color
|
|
954
|
+
* ("Bands"). */
|
|
955
|
+
rowLabel?: MessageLike;
|
|
917
956
|
}
|
|
918
957
|
interface SettingsSchema {
|
|
919
958
|
fields: SettingsField[];
|
|
@@ -1046,6 +1085,10 @@ declare abstract class Drawing {
|
|
|
1046
1085
|
max: number;
|
|
1047
1086
|
} | null;
|
|
1048
1087
|
abstract schema(): SettingsSchema;
|
|
1088
|
+
/** The text a fresh drawing of this type starts with ("Note", "Callout"), as a message,
|
|
1089
|
+
* or null for a type that seeds none. A new drawing stores its English source; the chart
|
|
1090
|
+
* that places one interactively writes it in its own language instead. */
|
|
1091
|
+
placeholderText(): MessageLike | null;
|
|
1049
1092
|
/**
|
|
1050
1093
|
* Editable per-level config for a rich "gear" settings panel (Fibonacci levels):
|
|
1051
1094
|
* each entry's `color` / `enabled` / `label` is mutated via a `levels.<i>.<field>`
|
|
@@ -1076,6 +1119,7 @@ declare abstract class Drawing {
|
|
|
1076
1119
|
*/
|
|
1077
1120
|
interface ToolDefinition {
|
|
1078
1121
|
type: DrawingTypeKey;
|
|
1122
|
+
/** The tool's name, in the language the definition was built for. */
|
|
1079
1123
|
label: string;
|
|
1080
1124
|
/** Inline SVG markup (no DOM). */
|
|
1081
1125
|
icon: string;
|
|
@@ -1098,7 +1142,8 @@ interface ToolbarDefinition {
|
|
|
1098
1142
|
/** A developer-supplied explicit group (just type keys; the registry fills the rest). */
|
|
1099
1143
|
interface ToolbarGroupConfig {
|
|
1100
1144
|
id: string;
|
|
1101
|
-
|
|
1145
|
+
/** The group's name; a message (`msg()`) reads in the chart's language. */
|
|
1146
|
+
label: MessageLike;
|
|
1102
1147
|
tools: DrawingTypeKey[];
|
|
1103
1148
|
}
|
|
1104
1149
|
/** Public `options.drawings` shape. `true` = default toolbar; object = customize. */
|
|
@@ -1107,14 +1152,15 @@ type DrawingsOption = boolean | {
|
|
|
1107
1152
|
tools?: DrawingTypeKey[];
|
|
1108
1153
|
groups?: ToolbarGroupConfig[];
|
|
1109
1154
|
};
|
|
1110
|
-
/** The default toolbar — every registered type, grouped into the canonical seven-button
|
|
1111
|
-
|
|
1155
|
+
/** The default toolbar — every registered type, grouped into the canonical seven-button
|
|
1156
|
+
* layout, labelled in `i18n`'s language (English without one). */
|
|
1157
|
+
declare function defaultToolbar(i18n?: Translator | null): ToolbarDefinition;
|
|
1112
1158
|
/**
|
|
1113
1159
|
* Resolve `options.drawings` into a concrete toolbar definition + initial visibility.
|
|
1114
1160
|
* Default (undefined) ⇒ toolbar VISIBLE; `false` ⇒ subsystem available but toolbar hidden
|
|
1115
1161
|
* (headless use still works via `chart.drawings.add(...)`); object ⇒ `toolbar ?? true`.
|
|
1116
1162
|
*/
|
|
1117
|
-
declare function buildToolbar(option: DrawingsOption | undefined): {
|
|
1163
|
+
declare function buildToolbar(option: DrawingsOption | undefined, i18n?: Translator | null): {
|
|
1118
1164
|
definition: ToolbarDefinition;
|
|
1119
1165
|
visible: boolean;
|
|
1120
1166
|
};
|
|
@@ -1133,7 +1179,10 @@ interface DrawingToolDefaults {
|
|
|
1133
1179
|
/** A named, saved look for one tool (a "style"): applied, it sets the same settings a
|
|
1134
1180
|
* remembered default does — style, text styling and per-type settings. */
|
|
1135
1181
|
interface DrawingToolTemplate {
|
|
1182
|
+
/** The style's name: its identity among the tool's styles. */
|
|
1136
1183
|
name: string;
|
|
1184
|
+
/** What a built-in style's name reads as in the chart's language. Absent ⇒ {@link name}. */
|
|
1185
|
+
label?: MessageLike;
|
|
1137
1186
|
settings: DrawingToolDefaults;
|
|
1138
1187
|
}
|
|
1139
1188
|
|
|
@@ -1412,6 +1461,11 @@ interface MarkClickEvent {
|
|
|
1412
1461
|
group?: string;
|
|
1413
1462
|
}
|
|
1414
1463
|
|
|
1464
|
+
/** The language and direction attributes of a renderer's root element (`null` = unset). */
|
|
1465
|
+
interface RendererRootAttributes {
|
|
1466
|
+
lang: string | null;
|
|
1467
|
+
dir: TextDirection | null;
|
|
1468
|
+
}
|
|
1415
1469
|
/** What a rendering backend supports — drives graceful degradation + warnings. */
|
|
1416
1470
|
interface RendererCapabilities {
|
|
1417
1471
|
panes: boolean;
|
|
@@ -1635,6 +1689,14 @@ interface IChartRenderer {
|
|
|
1635
1689
|
readFeature(key: string): unknown;
|
|
1636
1690
|
mount(container: HTMLElement, theme: VelaTheme): void;
|
|
1637
1691
|
setTheme(theme: VelaTheme): void;
|
|
1692
|
+
/**
|
|
1693
|
+
* Adopt the chart's localization: render text through `i18n` and numbers and dates
|
|
1694
|
+
* through `i18n.format`, then repaint. Called once after `mount` and again after every
|
|
1695
|
+
* `chart.setLocale`. `lang` and `dir` are what the renderer's root element should carry
|
|
1696
|
+
* (`null` = leave the attribute alone, the host page decides). Optional: a renderer
|
|
1697
|
+
* without it keeps English text and formatting.
|
|
1698
|
+
*/
|
|
1699
|
+
setLocalization?(i18n: Translator, root: RendererRootAttributes): void;
|
|
1638
1700
|
resize(): void;
|
|
1639
1701
|
destroy(): void;
|
|
1640
1702
|
/**
|
|
@@ -1895,7 +1957,7 @@ interface IChartRenderer {
|
|
|
1895
1957
|
/** Host-app settings tabs (callback rows) shown by the renderer's settings dialog.
|
|
1896
1958
|
* `id` names a section for the visibility policy (defaults to the title's slug). */
|
|
1897
1959
|
setSettingsSections?(sections: ReadonlyArray<{
|
|
1898
|
-
title:
|
|
1960
|
+
title: MessageLike;
|
|
1899
1961
|
rows: readonly unknown[];
|
|
1900
1962
|
id?: string;
|
|
1901
1963
|
}>): void;
|
|
@@ -2013,7 +2075,10 @@ type ThemeName = 'dark' | 'light';
|
|
|
2013
2075
|
* Built-in default: `NativeRenderer`.
|
|
2014
2076
|
* from `'vela/renderers/lwc'` and pass it as `options.renderer`. */
|
|
2015
2077
|
type RendererConstructor = new (opts?: RendererDisplayOptions) => IChartRenderer;
|
|
2016
|
-
|
|
2078
|
+
/** The chart's options. Its {@link LocalizationOptions} (`locale`, `direction`, `messages`,
|
|
2079
|
+
* `numberingSystem`, `hourCycle`, `weekStart`, `formatters`) change at runtime through
|
|
2080
|
+
* `chart.setLocale`. */
|
|
2081
|
+
interface VelaOptions extends MarketConfig, LocalizationOptions {
|
|
2017
2082
|
/** false = static history; true = history + live forming candle. */
|
|
2018
2083
|
live?: boolean;
|
|
2019
2084
|
theme?: ThemeName | VelaTheme;
|
|
@@ -2268,4 +2333,4 @@ interface AddIndicatorOptions {
|
|
|
2268
2333
|
title?: string;
|
|
2269
2334
|
}
|
|
2270
2335
|
|
|
2271
|
-
export { type
|
|
2336
|
+
export { type CandleStyle as $, type AxisLongPressEvent as A, type DrawingTypeKey as B, type CrosshairEvent as C, Drawing as D, type ToolbarDefinition as E, type MarketSnapshot as F, type AddIndicatorOptions as G, type AnimationConfig as H, type InputValue as I, type Background as J, type BoxFontFamily as K, type LineStyle as L, type MarketConfig as M, type NativeBackend as N, type OHLCV as O, type PriceStyle as P, type BoxHAlign as Q, type RendererCapabilities as R, type SerializedDrawing as S, type ThemeName as T, type Unsubscribe as U, type VisibleRangePreset as V, type WallClock as W, type BoxTextSize as X, type BoxVAlign as Y, type CandleBarColor as Z, type CandleSeries as _, type VisibleRange as a, type SeriesPoint as a$, type DataWindowGroup as a0, type DataWindowOHLC as a1, type DataWindowRow as a2, type DirtyRange as a3, type DrawingBox as a4, type DrawingExtend as a5, type DrawingIntent as a6, type DrawingLabel as a7, type DrawingLine as a8, type DrawingLinefill as a9, type LineLikeStyle as aA, type MarkContent as aB, type MarkContentSource as aC, type MarkGlyph as aD, type MarkPanelItem as aE, type MarkShape as aF, type MarkerPoint as aG, type MarkerSeries as aH, type MarketSwitch as aI, type PaneAxis as aJ, type PaneAxisBand as aK, type PaneHint as aL, type PaneKind as aM, type PolylinePoint as aN, type PriceAxisOptions as aO, type PriceAxisTick as aP, type PriceAxisTickContext as aQ, type PriceAxisTicksFn as aR, type PriceLine as aS, type Projector as aT, type ProviderName as aU, type RendererConstructor as aV, type Scene as aW, type SchemaPatch as aX, SecondClock as aY, type SeriesDisplay as aZ, type SeriesKind as a_, type DrawingMode as aa, type DrawingPoint as ab, type DrawingPolyline as ac, type DrawingSeriesBar as ad, type DrawingSeriesGateway as ae, type DrawingSeriesState as af, type DrawingStyle as ag, type DrawingTable as ah, type DrawingText as ai, type DrawingXLoc as aj, type DrawingsOption as ak, type Fill as al, type FillGradientStop as am, type IndicatorMeta as an, type InputCondition as ao, type InputDisplay as ap, type InputSchema as aq, type InputType as ar, type InputWhen as as, type IntroAnimation as at, type IntroConfig as au, type IntroStyle as av, type LabelStyle as aw, type LabelYLoc as ax, type LineLikeKind as ay, type LineLikeSeries as az, type VelaOptions as b, type SeriesSpec as b0, type SeriesSurface as b1, type SeriesValueDelta as b2, type SettingsField as b3, type SettingsSchema as b4, type SettingsVisibilityPolicy as b5, type TableCell as b6, type TableMerge as b7, type TablePosition as b8, type ToolbarGroupConfig as b9, type TradeExecution as ba, type ValuePatch as bb, buildToolbar as bc, defaultToolbar as bd, inputDeltas as be, inputVisible as bf, seriesInScale as bg, seriesShownOn as bh, type PaneInfo as bi, type DrawingToolDefaults as bj, type DrawingToolTemplate as bk, type VelaTheme as c, type MarketSession as d, type IChartRenderer as e, type RendererDisplayOptions as f, type IndicatorRenderHandle as g, type IndicatorStatus as h, type RendererRootAttributes as i, type Pane as j, type PaneAction as k, type MoveTarget as l, type IndicatorModel as m, type ScenePatch as n, type SymbolPickerFn as o, type LegendActionView as p, type LegendCalloutView as q, type InputChangeEvent as r, type ClickEvent as s, type TimelineMark as t, type MarkGroup as u, type MarkClickEvent as v, type DataWindowReadout as w, type IDrawingsRendererPort as x, type Millis as y, type SnapMode as z };
|