@tradecanvas/chart 1.3.0 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +131 -49
- package/dist/Chart.d.ts +724 -18
- package/dist/Chart.d.ts.map +1 -1
- package/dist/DataManager.d.ts +5 -0
- package/dist/DataManager.d.ts.map +1 -1
- package/dist/HistoryPager.d.ts +58 -0
- package/dist/HistoryPager.d.ts.map +1 -0
- package/dist/LayoutSession-CTZB90NX.cjs +2 -0
- package/dist/LayoutSession-CTZB90NX.cjs.map +1 -0
- package/dist/LayoutSession-CWn3sdbs.js +3967 -0
- package/dist/LayoutSession-CWn3sdbs.js.map +1 -0
- package/dist/PaneManager.d.ts.map +1 -1
- package/dist/ThemeManager.d.ts +5 -1
- package/dist/ThemeManager.d.ts.map +1 -1
- package/dist/chartA11y.d.ts +59 -0
- package/dist/chartA11y.d.ts.map +1 -0
- package/dist/charts/ChartTypeStrategy.d.ts +11 -4
- package/dist/charts/ChartTypeStrategy.d.ts.map +1 -1
- package/dist/grid/ChartGrid.d.ts +7 -1
- package/dist/grid/ChartGrid.d.ts.map +1 -1
- package/dist/i18n-CiQ8EDVs.js +1469 -0
- package/dist/i18n-CiQ8EDVs.js.map +1 -0
- package/dist/i18n-WsLA9SmD.cjs +2 -0
- package/dist/i18n-WsLA9SmD.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +24 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +74 -89
- package/dist/index.js.map +1 -1
- package/dist/indicatorLabel.d.ts +7 -0
- package/dist/indicatorLabel.d.ts.map +1 -0
- package/dist/layout/LayoutManager.d.ts +50 -0
- package/dist/layout/LayoutManager.d.ts.map +1 -1
- package/dist/layout/priceAxisWidth.d.ts +2 -0
- package/dist/layout/priceAxisWidth.d.ts.map +1 -1
- package/dist/regularHours.d.ts +10 -0
- package/dist/regularHours.d.ts.map +1 -0
- package/dist/state/LayoutSession.d.ts +101 -0
- package/dist/state/LayoutSession.d.ts.map +1 -0
- package/dist/state/layoutStorage.d.ts +46 -0
- package/dist/state/layoutStorage.d.ts.map +1 -0
- package/dist/trading/wireExecution.d.ts +7 -3
- package/dist/trading/wireExecution.d.ts.map +1 -1
- package/dist/widget/ChartWidget.d.ts +283 -10
- package/dist/widget/ChartWidget.d.ts.map +1 -1
- package/dist/widget/ChartWidgetGrid.d.ts +166 -0
- package/dist/widget/ChartWidgetGrid.d.ts.map +1 -0
- package/dist/widget/DrawingTemplateStore.d.ts +29 -8
- package/dist/widget/DrawingTemplateStore.d.ts.map +1 -1
- package/dist/widget/WatchlistStore.d.ts +65 -0
- package/dist/widget/WatchlistStore.d.ts.map +1 -0
- package/dist/widget/WidgetAccountPanel.d.ts +72 -0
- package/dist/widget/WidgetAccountPanel.d.ts.map +1 -0
- package/dist/widget/WidgetAlertsPanel.d.ts +50 -3
- package/dist/widget/WidgetAlertsPanel.d.ts.map +1 -1
- package/dist/widget/WidgetBracketBar.d.ts +3 -1
- package/dist/widget/WidgetBracketBar.d.ts.map +1 -1
- package/dist/widget/WidgetChartNav.d.ts +36 -0
- package/dist/widget/WidgetChartNav.d.ts.map +1 -0
- package/dist/widget/WidgetCommandPalette.d.ts +5 -1
- package/dist/widget/WidgetCommandPalette.d.ts.map +1 -1
- package/dist/widget/WidgetContextMenu.d.ts +40 -0
- package/dist/widget/WidgetContextMenu.d.ts.map +1 -0
- package/dist/widget/WidgetDataWindow.d.ts +3 -1
- package/dist/widget/WidgetDataWindow.d.ts.map +1 -1
- package/dist/widget/WidgetDepthLadder.d.ts +3 -1
- package/dist/widget/WidgetDepthLadder.d.ts.map +1 -1
- package/dist/widget/WidgetDrawingSettings.d.ts +108 -0
- package/dist/widget/WidgetDrawingSettings.d.ts.map +1 -0
- package/dist/widget/WidgetDrawingSidebar.d.ts +26 -1
- package/dist/widget/WidgetDrawingSidebar.d.ts.map +1 -1
- package/dist/widget/WidgetDrawingStyle.d.ts +3 -1
- package/dist/widget/WidgetDrawingStyle.d.ts.map +1 -1
- package/dist/widget/WidgetDropdown.d.ts.map +1 -1
- package/dist/widget/WidgetGoToDate.d.ts +46 -0
- package/dist/widget/WidgetGoToDate.d.ts.map +1 -0
- package/dist/widget/WidgetHistoryPill.d.ts +23 -0
- package/dist/widget/WidgetHistoryPill.d.ts.map +1 -0
- package/dist/widget/WidgetHotkeySheet.d.ts +3 -1
- package/dist/widget/WidgetHotkeySheet.d.ts.map +1 -1
- package/dist/widget/WidgetIndicatorLegend.d.ts +98 -0
- package/dist/widget/WidgetIndicatorLegend.d.ts.map +1 -0
- package/dist/widget/WidgetIndicatorSettings.d.ts +62 -7
- package/dist/widget/WidgetIndicatorSettings.d.ts.map +1 -1
- package/dist/widget/WidgetIntervalInput.d.ts +34 -0
- package/dist/widget/WidgetIntervalInput.d.ts.map +1 -0
- package/dist/widget/WidgetLayoutsDialog.d.ts +39 -0
- package/dist/widget/WidgetLayoutsDialog.d.ts.map +1 -0
- package/dist/widget/WidgetLayoutsUI.d.ts +37 -0
- package/dist/widget/WidgetLayoutsUI.d.ts.map +1 -0
- package/dist/widget/WidgetLoadingOverlay.d.ts.map +1 -1
- package/dist/widget/WidgetNamePrompt.d.ts +31 -0
- package/dist/widget/WidgetNamePrompt.d.ts.map +1 -0
- package/dist/widget/WidgetObjectTree.d.ts +21 -3
- package/dist/widget/WidgetObjectTree.d.ts.map +1 -1
- package/dist/widget/WidgetOrderTicket.d.ts +49 -0
- package/dist/widget/WidgetOrderTicket.d.ts.map +1 -0
- package/dist/widget/WidgetReplayBar.d.ts +52 -7
- package/dist/widget/WidgetReplayBar.d.ts.map +1 -1
- package/dist/widget/WidgetSettings.d.ts +26 -2
- package/dist/widget/WidgetSettings.d.ts.map +1 -1
- package/dist/widget/WidgetStatusBar.d.ts +19 -1
- package/dist/widget/WidgetStatusBar.d.ts.map +1 -1
- package/dist/widget/WidgetStyles.d.ts +3 -1
- package/dist/widget/WidgetStyles.d.ts.map +1 -1
- package/dist/widget/WidgetSymbolInfo.d.ts +64 -0
- package/dist/widget/WidgetSymbolInfo.d.ts.map +1 -0
- package/dist/widget/WidgetSymbolSearch.d.ts +28 -5
- package/dist/widget/WidgetSymbolSearch.d.ts.map +1 -1
- package/dist/widget/WidgetToolbar.d.ts +42 -4
- package/dist/widget/WidgetToolbar.d.ts.map +1 -1
- package/dist/widget/WidgetTooltip.d.ts +43 -0
- package/dist/widget/WidgetTooltip.d.ts.map +1 -0
- package/dist/widget/WidgetWatchlist.d.ts +53 -13
- package/dist/widget/WidgetWatchlist.d.ts.map +1 -1
- package/dist/widget/chartMenu.d.ts +40 -0
- package/dist/widget/chartMenu.d.ts.map +1 -0
- package/dist/widget/drawingMenu.d.ts +21 -0
- package/dist/widget/drawingMenu.d.ts.map +1 -0
- package/dist/widget/escapeHtml.d.ts +3 -0
- package/dist/widget/escapeHtml.d.ts.map +1 -0
- package/dist/widget/focusTrap.d.ts +8 -0
- package/dist/widget/focusTrap.d.ts.map +1 -0
- package/dist/widget/i18n.d.ts +20 -63
- package/dist/widget/i18n.d.ts.map +1 -1
- package/dist/widget/iconSet.d.ts +26 -0
- package/dist/widget/iconSet.d.ts.map +1 -0
- package/dist/widget/icons.d.ts +5 -0
- package/dist/widget/icons.d.ts.map +1 -1
- package/dist/widget/index.cjs +2145 -405
- package/dist/widget/index.cjs.map +1 -1
- package/dist/widget/index.d.ts +18 -1
- package/dist/widget/index.d.ts.map +1 -1
- package/dist/widget/index.js +7376 -1274
- package/dist/widget/index.js.map +1 -1
- package/dist/widget/indicatorTemplates.d.ts +24 -0
- package/dist/widget/indicatorTemplates.d.ts.map +1 -0
- package/dist/widget/keyTarget.d.ts +11 -0
- package/dist/widget/keyTarget.d.ts.map +1 -0
- package/dist/widget/legendValues.d.ts +19 -0
- package/dist/widget/legendValues.d.ts.map +1 -0
- package/dist/widget/locales/ar.d.ts +4 -0
- package/dist/widget/locales/ar.d.ts.map +1 -0
- package/dist/widget/locales/de.d.ts +4 -0
- package/dist/widget/locales/de.d.ts.map +1 -0
- package/dist/widget/locales/en.d.ts +722 -0
- package/dist/widget/locales/en.d.ts.map +1 -0
- package/dist/widget/locales/es.d.ts +4 -0
- package/dist/widget/locales/es.d.ts.map +1 -0
- package/dist/widget/locales/fr.d.ts +4 -0
- package/dist/widget/locales/fr.d.ts.map +1 -0
- package/dist/widget/locales/he.d.ts +4 -0
- package/dist/widget/locales/he.d.ts.map +1 -0
- package/dist/widget/locales/id.d.ts +4 -0
- package/dist/widget/locales/id.d.ts.map +1 -0
- package/dist/widget/locales/index.cjs +2 -0
- package/dist/widget/locales/index.cjs.map +1 -0
- package/dist/widget/locales/index.d.ts +33 -0
- package/dist/widget/locales/index.d.ts.map +1 -0
- package/dist/widget/locales/index.js +10089 -0
- package/dist/widget/locales/index.js.map +1 -0
- package/dist/widget/locales/ja.d.ts +4 -0
- package/dist/widget/locales/ja.d.ts.map +1 -0
- package/dist/widget/locales/ko.d.ts +4 -0
- package/dist/widget/locales/ko.d.ts.map +1 -0
- package/dist/widget/locales/pt.d.ts +4 -0
- package/dist/widget/locales/pt.d.ts.map +1 -0
- package/dist/widget/locales/ru.d.ts +4 -0
- package/dist/widget/locales/ru.d.ts.map +1 -0
- package/dist/widget/locales/th.d.ts +4 -0
- package/dist/widget/locales/th.d.ts.map +1 -0
- package/dist/widget/locales/tr.d.ts +4 -0
- package/dist/widget/locales/tr.d.ts.map +1 -0
- package/dist/widget/locales/vi.d.ts +4 -0
- package/dist/widget/locales/vi.d.ts.map +1 -0
- package/dist/widget/locales/zh.d.ts +4 -0
- package/dist/widget/locales/zh.d.ts.map +1 -0
- package/dist/widget/locales/zhHant.d.ts +4 -0
- package/dist/widget/locales/zhHant.d.ts.map +1 -0
- package/dist/widget/orderTicket.d.ts +27 -0
- package/dist/widget/orderTicket.d.ts.map +1 -0
- package/dist/widget/settingsControls.d.ts +24 -0
- package/dist/widget/settingsControls.d.ts.map +1 -0
- package/dist/widget/types.d.ts +215 -13
- package/dist/widget/types.d.ts.map +1 -1
- package/dist/widget/widgetConfig.d.ts +1 -5
- package/dist/widget/widgetConfig.d.ts.map +1 -1
- package/dist/widget/widgetLayout.d.ts +22 -0
- package/dist/widget/widgetLayout.d.ts.map +1 -0
- package/dist/widget/widgetLocales.d.ts +17 -0
- package/dist/widget/widgetLocales.d.ts.map +1 -0
- package/dist/widget/widgetTimeframes.d.ts +28 -0
- package/dist/widget/widgetTimeframes.d.ts.map +1 -0
- package/dist/widget/widgetTimezones.d.ts +32 -0
- package/dist/widget/widgetTimezones.d.ts.map +1 -0
- package/dist/widget/widgetUI.d.ts +126 -0
- package/dist/widget/widgetUI.d.ts.map +1 -0
- package/package.json +8 -3
- package/dist/DragDropImporter-BazeSQPD.cjs +0 -2
- package/dist/DragDropImporter-BazeSQPD.cjs.map +0 -1
- package/dist/DragDropImporter-cURSpfUb.js +0 -1883
- package/dist/DragDropImporter-cURSpfUb.js.map +0 -1
- package/dist/charts/IndicatorPriceRange.d.ts +0 -20
- package/dist/charts/IndicatorPriceRange.d.ts.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ja.d.ts","sourceRoot":"","sources":["../../../src/widget/locales/ja.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,UAAU;AACV,eAAO,MAAM,WAAW,EAAE,cAiuBzB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ko.d.ts","sourceRoot":"","sources":["../../../src/widget/locales/ko.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,UAAU;AACV,eAAO,MAAM,WAAW,EAAE,cAiuBzB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pt.d.ts","sourceRoot":"","sources":["../../../src/widget/locales/pt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,yBAAyB;AACzB,eAAO,MAAM,WAAW,EAAE,cAiuBzB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ru.d.ts","sourceRoot":"","sources":["../../../src/widget/locales/ru.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,cAAc;AACd,eAAO,MAAM,WAAW,EAAE,cAiuBzB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"th.d.ts","sourceRoot":"","sources":["../../../src/widget/locales/th.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,cAAc;AACd,eAAO,MAAM,WAAW,EAAE,cAiuBzB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tr.d.ts","sourceRoot":"","sources":["../../../src/widget/locales/tr.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,aAAa;AACb,eAAO,MAAM,WAAW,EAAE,cAiuBzB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vi.d.ts","sourceRoot":"","sources":["../../../src/widget/locales/vi.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,kBAAkB;AAClB,eAAO,MAAM,WAAW,EAAE,cAiuBzB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zh.d.ts","sourceRoot":"","sources":["../../../src/widget/locales/zh.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,WAAW;AACX,eAAO,MAAM,WAAW,EAAE,cAiuBzB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zhHant.d.ts","sourceRoot":"","sources":["../../../src/widget/locales/zhHant.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,WAAW;AACX,eAAO,MAAM,gBAAgB,EAAE,cAiuB9B,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { OrderPlaceIntent, OrderSide, TimeInForce } from '@tradecanvas/commons';
|
|
2
|
+
/** What the order ticket holds while it is filled in. */
|
|
3
|
+
export interface OrderTicketDraft {
|
|
4
|
+
side: OrderSide;
|
|
5
|
+
type: 'market' | 'limit' | 'stop';
|
|
6
|
+
quantity: number;
|
|
7
|
+
/** The limit or stop price (a market order fills at the market). */
|
|
8
|
+
price: number;
|
|
9
|
+
stopLoss: number | null;
|
|
10
|
+
takeProfit: number | null;
|
|
11
|
+
timeInForce: TimeInForce;
|
|
12
|
+
}
|
|
13
|
+
/** What is wrong with a draft, as message keys. */
|
|
14
|
+
export type OrderTicketProblem = 'quantity' | 'price'
|
|
15
|
+
/** A market order with no market price to fill at (no bars yet). */
|
|
16
|
+
| 'market' | 'stopLoss' | 'takeProfit' | 'stopLossSide' | 'takeProfitSide' | 'limitSide' | 'stopSide';
|
|
17
|
+
/**
|
|
18
|
+
* The problems with a draft: a quantity or price that isn't positive, a stop-loss
|
|
19
|
+
* or take-profit on the wrong side of the entry, a limit or stop on the wrong side
|
|
20
|
+
* of the market (it would fill at once).
|
|
21
|
+
*/
|
|
22
|
+
export declare function orderTicketProblems(draft: OrderTicketDraft, lastPrice: number | null): OrderTicketProblem[];
|
|
23
|
+
/** The order a draft asks for. */
|
|
24
|
+
export declare function orderTicketIntent(draft: OrderTicketDraft, lastPrice: number | null): OrderPlaceIntent;
|
|
25
|
+
/** Reward over risk for a draft with both a stop-loss and a take-profit, or null. */
|
|
26
|
+
export declare function orderTicketRiskReward(draft: OrderTicketDraft, lastPrice: number | null): number | null;
|
|
27
|
+
//# sourceMappingURL=orderTicket.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orderTicket.d.ts","sourceRoot":"","sources":["../../src/widget/orderTicket.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAErF,yDAAyD;AACzD,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,SAAS,CAAC;IAChB,IAAI,EAAE,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,oEAAoE;IACpE,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,WAAW,EAAE,WAAW,CAAC;CAC1B;AAED,mDAAmD;AACnD,MAAM,MAAM,kBAAkB,GAC1B,UAAU,GACV,OAAO;AACT,oEAAoE;GAClE,QAAQ,GACR,UAAU,GACV,YAAY,GACZ,cAAc,GACd,gBAAgB,GAChB,WAAW,GACX,UAAU,CAAC;AAUf;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,kBAAkB,EAAE,CAqB3G;AAED,kCAAkC;AAClC,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,gBAAgB,CAYrG;AAED,qFAAqF;AACrF,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI,CAKtG"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Form controls shared by the settings dialogs: a labelled row, a switch, a
|
|
3
|
+
* number field, a colour picker and a select. Each calls back on change.
|
|
4
|
+
*/
|
|
5
|
+
/** A labelled control: clicking the label reaches the control. */
|
|
6
|
+
export declare function settingsRow(label: string, control: HTMLElement): HTMLLabelElement;
|
|
7
|
+
export declare function toggleSwitch(value: boolean, onChange: (value: boolean) => void): HTMLButtonElement;
|
|
8
|
+
export declare function numberInput(value: number, range: {
|
|
9
|
+
min?: number;
|
|
10
|
+
max?: number;
|
|
11
|
+
step?: number | 'any';
|
|
12
|
+
}, onChange: (value: number) => void): HTMLInputElement;
|
|
13
|
+
export declare function colorInput(value: string, onInput: (value: string) => void): HTMLInputElement;
|
|
14
|
+
export declare function selectInput(choices: readonly {
|
|
15
|
+
value: string;
|
|
16
|
+
label: string;
|
|
17
|
+
}[], value: string, onChange: (value: string) => void): HTMLSelectElement;
|
|
18
|
+
/** A colour as `#rrggbb` (what a colour input takes); black if unreadable. */
|
|
19
|
+
export declare function toHex(color: unknown): string;
|
|
20
|
+
/** The alpha of a colour (1 for `#rgb` / `#rrggbb`). */
|
|
21
|
+
export declare function colorAlpha(color: unknown): number;
|
|
22
|
+
/** `#rrggbb` with an alpha, as `rgba(…)`. */
|
|
23
|
+
export declare function withAlpha(hex: string, alpha: number): string;
|
|
24
|
+
//# sourceMappingURL=settingsControls.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settingsControls.d.ts","sourceRoot":"","sources":["../../src/widget/settingsControls.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,kEAAkE;AAClE,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,GAAG,gBAAgB,CAQjF;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,GAAG,iBAAiB,CAalG;AAED,wBAAgB,WAAW,CACzB,KAAK,EAAE,MAAM,EACb,KAAK,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,GAAG,KAAK,CAAA;CAAE,EAC5D,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,GAChC,gBAAgB,CAkBlB;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,GAAG,gBAAgB,CAO5F;AAED,wBAAgB,WAAW,CACzB,OAAO,EAAE,SAAS;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EAAE,EACpD,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,GAChC,iBAAiB,CAYnB;AAED,8EAA8E;AAC9E,wBAAgB,KAAK,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAQ5C;AAED,wDAAwD;AACxD,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAIjD;AAED,6CAA6C;AAC7C,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAI5D"}
|
package/dist/widget/types.d.ts
CHANGED
|
@@ -1,9 +1,35 @@
|
|
|
1
|
-
import { Theme, ThemeName, ChartType, TimeFrame, DrawingToolType, DataAdapter, ChartOptions, PriceScaleMode } from '@tradecanvas/commons';
|
|
1
|
+
import { ChartTypeOptions, Theme, ThemeName, ChartType, TimeFrame, DrawingToolType, DataAdapter, ChartOptions, NewsItem, PriceScaleMode, QuoteSource, SymbolInfo } from '@tradecanvas/commons';
|
|
2
2
|
import { Chart } from '../Chart.js';
|
|
3
|
+
import { WatchlistList } from './WatchlistStore.js';
|
|
4
|
+
/** The watchlist's lists and where its rows' quotes come from. */
|
|
5
|
+
export interface WatchlistOptions {
|
|
6
|
+
/** The lists to start with; default one list of `symbols`. */
|
|
7
|
+
lists?: WatchlistList[];
|
|
8
|
+
/** The list shown first, by id. */
|
|
9
|
+
activeList?: string;
|
|
10
|
+
/** Keep the lists in this browser (localStorage) between visits. Default `false`. */
|
|
11
|
+
persist?: boolean;
|
|
12
|
+
/** The localStorage key when `persist` is on. Default `'tcw:watchlists'`. */
|
|
13
|
+
storageKey?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Where the rows' quotes come from: default the adapter's `subscribeQuotes`
|
|
16
|
+
* when it has one (Binance does); `false` for only what you push with
|
|
17
|
+
* `setQuotes` / `setWatchlistEntry`.
|
|
18
|
+
*/
|
|
19
|
+
quotes?: QuoteSource | false;
|
|
20
|
+
/** After every change to the lists (to keep them yourself). */
|
|
21
|
+
onChange?: (lists: WatchlistList[], activeList: string) => void;
|
|
22
|
+
}
|
|
3
23
|
export interface ChartWidgetOptions {
|
|
4
24
|
symbol?: string;
|
|
5
25
|
timeframe?: TimeFrame;
|
|
6
26
|
theme?: ThemeName | Theme;
|
|
27
|
+
/**
|
|
28
|
+
* The widget's look: its corners, sizes, type, lines, shadows and bars.
|
|
29
|
+
* A preset (`'studio'`, the default; `'terminal'`; `'capsule'`) or your
|
|
30
|
+
* theme over one. Colours stay with `theme`.
|
|
31
|
+
*/
|
|
32
|
+
ui?: import('./widgetUI.js').WidgetUIPreset | import('./widgetUI.js').WidgetUITheme;
|
|
7
33
|
/**
|
|
8
34
|
* UI chrome language (toolbar, watchlist, indicator picker, status bar,
|
|
9
35
|
* settings panel, hotkey sheet). A built-in table ('en', the default, or
|
|
@@ -19,6 +45,19 @@ export interface ChartWidgetOptions {
|
|
|
19
45
|
settings?: boolean;
|
|
20
46
|
trading?: boolean;
|
|
21
47
|
statusBar?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Range presets (1D, 5D, 1M … All) and "go to date" (also Alt+G) on the
|
|
50
|
+
* status bar. Default `true`; needs the status bar.
|
|
51
|
+
*/
|
|
52
|
+
rangeBar?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* The indicators on the chart, under the OHLCV legend and at the top of
|
|
55
|
+
* their panes, with show / settings / remove. Default `true`; `false`
|
|
56
|
+
* leaves only the toolbar's indicator count.
|
|
57
|
+
*/
|
|
58
|
+
indicatorLegend?: boolean;
|
|
59
|
+
/** Fullscreen button in the toolbar, where the browser allows it. Default `true`. */
|
|
60
|
+
fullscreen?: boolean;
|
|
22
61
|
/**
|
|
23
62
|
* Price-alerts UI — a bell button in the toolbar that opens a floating panel
|
|
24
63
|
* to add / list / delete price alerts, plus a toast when one triggers.
|
|
@@ -43,17 +82,80 @@ export interface ChartWidgetOptions {
|
|
|
43
82
|
* order-book feed via `widget.setDepth`). Clicks emit `orderPlace` intents.
|
|
44
83
|
*/
|
|
45
84
|
depthLadder?: boolean;
|
|
85
|
+
/**
|
|
86
|
+
* The account panel at the bottom: open positions with their profit and
|
|
87
|
+
* loss, working orders and the fills so far, with close, reverse and cancel,
|
|
88
|
+
* and an order ticket. A toolbar button opens it. Default `true` when
|
|
89
|
+
* trading is on.
|
|
90
|
+
*/
|
|
91
|
+
accountPanel?: boolean;
|
|
92
|
+
/**
|
|
93
|
+
* Named layouts: a toolbar button to save the chart (symbol, interval,
|
|
94
|
+
* scale, chart type, indicators, drawings, alerts) under a name, open,
|
|
95
|
+
* rename and delete layouts, and auto-save the one open; Ctrl/Cmd+S saves.
|
|
96
|
+
* Kept in this browser's `localStorage` unless `storage` says otherwise.
|
|
97
|
+
* Default `true`.
|
|
98
|
+
*/
|
|
99
|
+
layouts?: boolean | WidgetLayoutsOptions;
|
|
100
|
+
/**
|
|
101
|
+
* Indicator templates: the indicators menu saves the chart's indicators
|
|
102
|
+
* (inputs, style, levels, panes) under a name and applies them in one go.
|
|
103
|
+
* Kept in this browser's `localStorage`. Default `true`.
|
|
104
|
+
*/
|
|
105
|
+
indicatorTemplates?: boolean;
|
|
106
|
+
/**
|
|
107
|
+
* Type a number on the chart (after using it) to change the interval:
|
|
108
|
+
* `5`, `15m`, `1h`, `1D`, then Enter. Default `true`.
|
|
109
|
+
*/
|
|
110
|
+
intervalTyping?: boolean;
|
|
111
|
+
/**
|
|
112
|
+
* Your own entries at the end of the chart's right-click menus (and of the
|
|
113
|
+
* "+" by the price axis), after the widget's. Called each time a menu opens.
|
|
114
|
+
*/
|
|
115
|
+
chartMenuItems?: (context: ChartMenuItemsContext) => readonly WidgetMenuItem[];
|
|
46
116
|
symbols?: string[];
|
|
47
117
|
timeframes?: TimeFrame[];
|
|
118
|
+
/** Let users type their own intervals (7m, 90m, 2h…) in the timeframe menu. Default `true`. */
|
|
119
|
+
customTimeframes?: boolean;
|
|
48
120
|
chartTypes?: ChartType[];
|
|
49
121
|
adapter?: DataAdapter;
|
|
122
|
+
/**
|
|
123
|
+
* Search symbols as the user types in the symbol search (names, exchanges).
|
|
124
|
+
* Defaults to the adapter's `searchSymbols`; without either, the search
|
|
125
|
+
* filters `symbols`.
|
|
126
|
+
*/
|
|
127
|
+
searchSymbols?: (query: string, signal: AbortSignal) => Promise<SymbolInfo[]>;
|
|
50
128
|
historyLimit?: number;
|
|
129
|
+
/** Bars per request when scrolling back for older bars (adapters with `fetchHistoryBefore`). Default 500. */
|
|
130
|
+
historyPageSize?: number;
|
|
51
131
|
chartOptions?: Partial<ChartOptions>;
|
|
52
132
|
/**
|
|
53
|
-
*
|
|
54
|
-
*
|
|
133
|
+
* A watchlist sidebar on the right: lists of symbols with last price,
|
|
134
|
+
* % change and a mini sparkline; lists can be added, renamed, deleted and
|
|
135
|
+
* reordered. `true` starts with one list of `symbols`. Default `false`.
|
|
55
136
|
*/
|
|
56
|
-
watchlist?: boolean;
|
|
137
|
+
watchlist?: boolean | WatchlistOptions;
|
|
138
|
+
/**
|
|
139
|
+
* The symbol info panel (names, price and move, market status, the day's
|
|
140
|
+
* numbers, hours, news) and its toolbar button. Default `true`.
|
|
141
|
+
*/
|
|
142
|
+
symbolInfo?: boolean;
|
|
143
|
+
/**
|
|
144
|
+
* Buttons over the chart, shown while the pointer is on it: zoom out and
|
|
145
|
+
* in, scroll earlier and later, reset the view. Default `true`.
|
|
146
|
+
*/
|
|
147
|
+
navigation?: boolean;
|
|
148
|
+
/**
|
|
149
|
+
* Writing direction of the widget's chrome: `'rtl'` mirrors the toolbar,
|
|
150
|
+
* drawing tools, menus and dialogs (the chart keeps time running left to
|
|
151
|
+
* right). Default `'auto'`: right to left for Arabic, Hebrew, Persian, Urdu.
|
|
152
|
+
*/
|
|
153
|
+
dir?: 'ltr' | 'rtl' | 'auto';
|
|
154
|
+
/**
|
|
155
|
+
* Headlines for the symbol info panel, newest first; default the adapter's
|
|
156
|
+
* `fetchNews` when it has one. Links that aren't web pages are dropped.
|
|
157
|
+
*/
|
|
158
|
+
news?: (symbol: string, limit: number) => Promise<NewsItem[]>;
|
|
57
159
|
/**
|
|
58
160
|
* Drag-and-drop CSV / JSON file import onto the chart. Default `true`.
|
|
59
161
|
* Set to `false` to disable (e.g. if the chart sits inside a larger
|
|
@@ -93,23 +195,94 @@ export interface ChartWidgetOptions {
|
|
|
93
195
|
onTimeframeChange?: (tf: TimeFrame) => void;
|
|
94
196
|
onReady?: (chart: Chart) => void;
|
|
95
197
|
}
|
|
198
|
+
/** Where a chart menu opened, for `chartMenuItems`. */
|
|
199
|
+
export interface ChartMenuItemsContext {
|
|
200
|
+
/** The part of the chart right-clicked, or `'priceAxisAdd'` for the "+" by the price axis. */
|
|
201
|
+
area: import('@tradecanvas/commons').ChartContextArea | 'priceAxisAdd';
|
|
202
|
+
/** The price there, on the price pane and the price axis. */
|
|
203
|
+
price?: number;
|
|
204
|
+
/** The time there, on the plot and the time axis (ms). */
|
|
205
|
+
time?: number;
|
|
206
|
+
}
|
|
207
|
+
/** An entry of yours in a widget menu. */
|
|
208
|
+
export interface WidgetMenuItem {
|
|
209
|
+
label: string;
|
|
210
|
+
/** A built-in icon's name (see the docs' icon list). */
|
|
211
|
+
icon?: string;
|
|
212
|
+
/** Shown in red, for something that removes. */
|
|
213
|
+
danger?: boolean;
|
|
214
|
+
/** Makes it a switch, ticked when `true`. */
|
|
215
|
+
checked?: boolean;
|
|
216
|
+
onSelect: () => void;
|
|
217
|
+
}
|
|
218
|
+
/** A button of yours on the widget's toolbar; see `ChartWidget.addToolbarButton`. */
|
|
219
|
+
export interface ToolbarButtonSpec {
|
|
220
|
+
/** Tells your buttons apart (`data-host-button` on the element). */
|
|
221
|
+
id: string;
|
|
222
|
+
/** Its accessible name and tooltip. */
|
|
223
|
+
label: string;
|
|
224
|
+
/** A built-in icon's name, or an element of your own (an `<svg>`, say). */
|
|
225
|
+
icon?: string | Element;
|
|
226
|
+
/** Text after the icon. Without an icon or text the label shows. */
|
|
227
|
+
text?: string;
|
|
228
|
+
/** With the chart controls on the left, or the panel buttons on the right. Default `'right'`. */
|
|
229
|
+
side?: 'left' | 'right';
|
|
230
|
+
/** A switch that shows pressed while on (see `setActive`). */
|
|
231
|
+
toggle?: boolean;
|
|
232
|
+
onClick: (button: HTMLButtonElement) => void;
|
|
233
|
+
}
|
|
234
|
+
export interface ToolbarButtonHandle {
|
|
235
|
+
readonly element: HTMLButtonElement;
|
|
236
|
+
/** Show a `toggle` button as on or off. */
|
|
237
|
+
setActive(on: boolean): void;
|
|
238
|
+
setText(text: string): void;
|
|
239
|
+
remove(): void;
|
|
240
|
+
}
|
|
241
|
+
export interface WidgetLayoutsOptions {
|
|
242
|
+
/** Where the layouts are kept: your server, say. Default: `localStorageLayouts()`. */
|
|
243
|
+
storage?: import('../state/layoutStorage.js').LayoutStorage;
|
|
244
|
+
/** Save the open layout by itself as it changes. Default `true`. */
|
|
245
|
+
autoSave?: boolean;
|
|
246
|
+
/** How long changes settle before an auto-save. Default 1500 ms. */
|
|
247
|
+
debounceMs?: number;
|
|
248
|
+
/** Open the layout saved last when the widget starts. Default `false`. */
|
|
249
|
+
openLast?: boolean;
|
|
250
|
+
}
|
|
251
|
+
export interface ActiveIndicatorInfo {
|
|
252
|
+
id: string;
|
|
253
|
+
/** Chip label: short name plus the main parameters, e.g. "EMA 20". */
|
|
254
|
+
label: string;
|
|
255
|
+
}
|
|
96
256
|
export interface WidgetState {
|
|
97
257
|
symbol: string;
|
|
98
258
|
timeframe: TimeFrame;
|
|
99
259
|
chartType: ChartType;
|
|
100
260
|
isDark: boolean;
|
|
101
|
-
|
|
261
|
+
/** One entry per indicator instance (several EMAs can be on at once). */
|
|
262
|
+
activeIndicators: Map<string, ActiveIndicatorInfo>;
|
|
102
263
|
activeTool: DrawingToolType | null;
|
|
103
264
|
magnetEnabled: boolean;
|
|
265
|
+
/** The magnet snaps always, not only near a price (with `magnetEnabled`). */
|
|
266
|
+
magnetStrong: boolean;
|
|
267
|
+
/** The eraser is on: a click on a drawing removes it. */
|
|
268
|
+
eraser: boolean;
|
|
269
|
+
/** The zoom tool waits for a box to zoom into. */
|
|
270
|
+
zoomArea: boolean;
|
|
271
|
+
/** Keep the drawing tool after each drawing. */
|
|
272
|
+
stayInDrawing: boolean;
|
|
104
273
|
connectionState: string;
|
|
105
274
|
connectionMessage: string;
|
|
106
275
|
}
|
|
107
276
|
export interface ToolbarConfig {
|
|
108
277
|
symbols: string[];
|
|
278
|
+
/** Every timeframe on offer, shortest first; the menu lists them all. */
|
|
109
279
|
timeframes: {
|
|
110
280
|
label: string;
|
|
111
281
|
value: TimeFrame;
|
|
282
|
+
custom?: boolean;
|
|
112
283
|
}[];
|
|
284
|
+
/** The ones shown as buttons. Defaults to all of `timeframes`. */
|
|
285
|
+
timeframeFavorites?: TimeFrame[];
|
|
113
286
|
chartTypes: {
|
|
114
287
|
label: string;
|
|
115
288
|
value: ChartType;
|
|
@@ -119,18 +292,34 @@ export interface ToolbarConfig {
|
|
|
119
292
|
}
|
|
120
293
|
export interface ToolbarCallbacks {
|
|
121
294
|
onSymbolClick: () => void;
|
|
295
|
+
/** The symbol info button: shown only when given. */
|
|
296
|
+
onSymbolInfo?: () => void;
|
|
122
297
|
onTimeframe: (tf: TimeFrame) => void;
|
|
298
|
+
/** Pin or unpin a timeframe; enables the timeframe menu. */
|
|
299
|
+
onToggleTimeframeFavorite?: (tf: TimeFrame) => void;
|
|
300
|
+
/** Add a typed interval ("7m", "90", "2h"); false when it isn't one. Shows the custom-interval field. */
|
|
301
|
+
onAddTimeframe?: (text: string) => boolean;
|
|
302
|
+
/** Remove a custom interval from the menu. */
|
|
303
|
+
onRemoveTimeframe?: (tf: TimeFrame) => void;
|
|
123
304
|
onChartType: (type: ChartType) => void;
|
|
124
305
|
onAddIndicator: (id: string) => void;
|
|
125
|
-
onRemoveIndicator: (instanceId: string) => void;
|
|
126
306
|
onScreenshot: () => void;
|
|
127
307
|
onSettings: () => void;
|
|
128
308
|
onToggleTheme: () => void;
|
|
129
309
|
onToggleReplay?: () => void;
|
|
130
310
|
onToggleAlerts?: () => void;
|
|
131
311
|
onToggleObjects?: () => void;
|
|
312
|
+
onToggleAccount?: () => void;
|
|
313
|
+
/** The layouts button was pressed: open its menu under it. */
|
|
314
|
+
onLayouts?: (anchor: HTMLElement) => void;
|
|
315
|
+
/** Indicator templates in the indicators menu: apply, save the chart's, delete. */
|
|
316
|
+
onApplyIndicatorTemplate?: (name: string) => void;
|
|
317
|
+
onSaveIndicatorTemplate?: () => void;
|
|
318
|
+
onDeleteIndicatorTemplate?: (name: string) => void;
|
|
132
319
|
onBracket?: (side: 'buy' | 'sell') => void;
|
|
133
320
|
onToggleLadder?: () => void;
|
|
321
|
+
/** Shown only when given (and the browser allows fullscreen). */
|
|
322
|
+
onToggleFullscreen?: () => void;
|
|
134
323
|
}
|
|
135
324
|
export interface SidebarConfig {
|
|
136
325
|
drawingToolGroups: DrawingToolGroupDef[];
|
|
@@ -140,12 +329,16 @@ export interface SidebarConfig {
|
|
|
140
329
|
export interface SidebarCallbacks {
|
|
141
330
|
onDrawingTool: (tool: DrawingToolType) => void;
|
|
142
331
|
onCancelDrawing: () => void;
|
|
143
|
-
|
|
332
|
+
/** Omitted when the magnet is switched off (`features.drawingMagnet: false`). Cycles off, weak, strong. */
|
|
333
|
+
onToggleMagnet?: () => void;
|
|
334
|
+
onToggleEraser?: () => void;
|
|
335
|
+
onToggleZoomArea?: () => void;
|
|
144
336
|
onToggleFavorite?: (tool: DrawingToolType) => void;
|
|
145
337
|
onUndo: () => void;
|
|
146
338
|
onRedo: () => void;
|
|
147
339
|
onClearDrawings: () => void;
|
|
148
340
|
onToggleStyle?: () => void;
|
|
341
|
+
onToggleStayInDrawing?: () => void;
|
|
149
342
|
}
|
|
150
343
|
export interface SettingsCallbacks {
|
|
151
344
|
onChange: (patch: Partial<ChartSettingsState>) => void;
|
|
@@ -177,13 +370,27 @@ export interface ChartSettingsState {
|
|
|
177
370
|
periodLevelsPeriod: 'day' | 'week';
|
|
178
371
|
legendVisible: boolean;
|
|
179
372
|
barCountdown: boolean;
|
|
373
|
+
/** Tag each indicator line's latest value on its scale. */
|
|
374
|
+
indicatorValueLabels: boolean;
|
|
180
375
|
logScale: boolean;
|
|
181
376
|
scaleMode: PriceScaleMode;
|
|
182
377
|
autoScale: boolean;
|
|
378
|
+
/** Price scale upside down. */
|
|
379
|
+
invertScale: boolean;
|
|
380
|
+
/** A price scale on the left too (it carries overlays put on it, else mirrors the price scale). */
|
|
381
|
+
leftPriceScale: boolean;
|
|
183
382
|
crosshairMode: 'normal' | 'magnet' | 'hidden';
|
|
184
383
|
numberLocale: string;
|
|
185
|
-
/** 'local' = browser timezone
|
|
384
|
+
/** 'local' = browser timezone; an IANA zone ('America/New_York'); or a fixed UTC offset in minutes (as a string, from older settings). */
|
|
186
385
|
timezone: string;
|
|
386
|
+
/** Lines at the highest high and lowest low on screen. */
|
|
387
|
+
highLowLines: boolean;
|
|
388
|
+
/** The main series (bars, candles, line) shown. */
|
|
389
|
+
mainSeriesVisible: boolean;
|
|
390
|
+
/** Bars outside the symbol's regular hours shown (pre- and post-market). */
|
|
391
|
+
extendedHours: boolean;
|
|
392
|
+
/** Renko box, Line Break lines, Kagi reversal, Point & Figure box and reversal, range. */
|
|
393
|
+
chartTypeOptions: ChartTypeOptions;
|
|
187
394
|
}
|
|
188
395
|
export interface IndicatorDef {
|
|
189
396
|
id: string;
|
|
@@ -197,9 +404,4 @@ export interface DrawingToolGroupDef {
|
|
|
197
404
|
value: DrawingToolType;
|
|
198
405
|
}[];
|
|
199
406
|
}
|
|
200
|
-
export interface ActiveIndicator {
|
|
201
|
-
instanceId: string;
|
|
202
|
-
id: string;
|
|
203
|
-
label: string;
|
|
204
|
-
}
|
|
205
407
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/widget/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,KAAK,EACL,SAAS,EACT,SAAS,EACT,SAAS,EACT,eAAe,EACf,WAAW,EACX,YAAY,EACZ,cAAc,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/widget/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,KAAK,EACL,SAAS,EACT,SAAS,EACT,SAAS,EACT,eAAe,EACf,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,cAAc,EACd,WAAW,EACX,UAAU,EACX,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,kEAAkE;AAClE,MAAM,WAAW,gBAAgB;IAC/B,8DAA8D;IAC9D,KAAK,CAAC,EAAE,aAAa,EAAE,CAAC;IACxB,mCAAmC;IACnC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,qFAAqF;IACrF,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,6EAA6E;IAC7E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,MAAM,CAAC,EAAE,WAAW,GAAG,KAAK,CAAC;IAC7B,+DAA+D;IAC/D,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,EAAE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,YAAY,EAAE,MAAM,CAAC;IACrB,0IAA0I;IAC1I,QAAQ,EAAE,MAAM,CAAC;IACjB,0DAA0D;IAC1D,YAAY,EAAE,OAAO,CAAC;IACtB,mDAAmD;IACnD,iBAAiB,EAAE,OAAO,CAAC;IAC3B,4EAA4E;IAC5E,aAAa,EAAE,OAAO,CAAC;IACvB,0FAA0F;IAC1F,gBAAgB,EAAE,gBAAgB,CAAC;CACpC;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,SAAS,GAAG,OAAO,CAAC;CAC3B;AAED,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,eAAe,CAAA;KAAE,EAAE,CAAC;CACpD"}
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
import { ChartType
|
|
1
|
+
import { ChartType } from '@tradecanvas/commons';
|
|
2
2
|
import { IndicatorDef, DrawingToolGroupDef, ChartSettingsState } from './types.js';
|
|
3
|
-
export declare const TIMEFRAMES: {
|
|
4
|
-
label: string;
|
|
5
|
-
value: TimeFrame;
|
|
6
|
-
}[];
|
|
7
3
|
export declare const CHART_TYPES: {
|
|
8
4
|
label: string;
|
|
9
5
|
value: ChartType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widgetConfig.d.ts","sourceRoot":"","sources":["../../src/widget/widgetConfig.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAmB,
|
|
1
|
+
{"version":3,"file":"widgetConfig.d.ts","sourceRoot":"","sources":["../../src/widget/widgetConfig.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAmB,MAAM,sBAAsB,CAAC;AACvE,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAExF,eAAO,MAAM,WAAW,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,SAAS,CAAA;CAAE,EAmB5D,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,mBAAmB,EAuIpD,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,YAAY,EAgGpC,CAAC;AAEF,eAAO,MAAM,kBAAkB,UAG9B,CAAC;AAEF,eAAO,MAAM,eAAe,UAE3B,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,kBAsC9B,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { PriceScaleMode, TimeFrame } from '@tradecanvas/commons';
|
|
2
|
+
/** What a widget's named layout holds. */
|
|
3
|
+
export interface WidgetLayoutContent {
|
|
4
|
+
v: 1;
|
|
5
|
+
symbol: string;
|
|
6
|
+
timeframe: TimeFrame;
|
|
7
|
+
scaleMode: PriceScaleMode;
|
|
8
|
+
invertScale: boolean;
|
|
9
|
+
/** The chart's own state, as `Chart.saveState()` writes it: chart type, indicators, drawings, alerts. */
|
|
10
|
+
chart: Record<string, unknown> | null;
|
|
11
|
+
}
|
|
12
|
+
/** The chart's state without what a layout leaves to the viewer (the theme) or never compares (when it was taken). */
|
|
13
|
+
export declare function layoutChartState(state: Record<string, unknown>): Record<string, unknown>;
|
|
14
|
+
/**
|
|
15
|
+
* A widget layout read back from storage (or a host's server), or `null` when
|
|
16
|
+
* it is not one. Whatever comes in is checked: an interval it can't read
|
|
17
|
+
* refuses the layout, and a theme in the chart's state is dropped.
|
|
18
|
+
*/
|
|
19
|
+
export declare function readWidgetLayout(value: unknown): WidgetLayoutContent | null;
|
|
20
|
+
/** Parse a layout's JSON; `null` for anything that does not parse. */
|
|
21
|
+
export declare function parseLayoutJson(json: string): unknown;
|
|
22
|
+
//# sourceMappingURL=widgetLayout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"widgetLayout.d.ts","sourceRoot":"","sources":["../../src/widget/widgetLayout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAGtE,0CAA0C;AAC1C,MAAM,WAAW,mBAAmB;IAClC,CAAC,EAAE,CAAC,CAAC;IACL,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,SAAS,CAAC;IACrB,SAAS,EAAE,cAAc,CAAC;IAC1B,WAAW,EAAE,OAAO,CAAC;IACrB,yGAAyG;IACzG,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;CACvC;AAMD,sHAAsH;AACtH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAGxF;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,mBAAmB,GAAG,IAAI,CAW3E;AAED,sEAAsE;AACtE,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAMrD"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { DrawingToolGroupDef } from './types.js';
|
|
2
|
+
import { Translator } from './i18n.js';
|
|
3
|
+
/** Number formats the settings offer, by locale tag. */
|
|
4
|
+
export declare const NUMBER_LOCALES: readonly string[];
|
|
5
|
+
/** "de-DE (65.234,00)": each format with a sample number; the current one stays listed. */
|
|
6
|
+
export declare function numberLocaleOptions(current: string): {
|
|
7
|
+
value: string;
|
|
8
|
+
label: string;
|
|
9
|
+
}[];
|
|
10
|
+
/** A chart type's name in the widget's language (an unknown type keeps its own). */
|
|
11
|
+
export declare function chartTypeLabel(ct: {
|
|
12
|
+
value: string;
|
|
13
|
+
label: string;
|
|
14
|
+
}, t: Translator): string;
|
|
15
|
+
/** The drawing-tool groups with names in the widget's language (unknown tools keep theirs). */
|
|
16
|
+
export declare function localizeToolGroups(groups: readonly DrawingToolGroupDef[], t: Translator): DrawingToolGroupDef[];
|
|
17
|
+
//# sourceMappingURL=widgetLocales.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"widgetLocales.d.ts","sourceRoot":"","sources":["../../src/widget/widgetLocales.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,KAAK,EAAc,UAAU,EAAE,MAAM,WAAW,CAAC;AAExD,wDAAwD;AACxD,eAAO,MAAM,cAAc,EAAE,SAAS,MAAM,EAG3C,CAAC;AAIF,2FAA2F;AAC3F,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EAAE,CAWvF;AAmBD,oFAAoF;AACpF,wBAAgB,cAAc,CAAC,EAAE,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EAAE,CAAC,EAAE,UAAU,GAAG,MAAM,CAI1F;AAED,+FAA+F;AAC/F,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,SAAS,mBAAmB,EAAE,EAAE,CAAC,EAAE,UAAU,GAAG,mBAAmB,EAAE,CAS/G"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { TimeFrame } from '@tradecanvas/commons';
|
|
2
|
+
/** The timeframe menu when the host offers no list of its own. */
|
|
3
|
+
export declare const WIDGET_TIMEFRAMES: TimeFrame[];
|
|
4
|
+
/** On the toolbar until the user pins others. */
|
|
5
|
+
export declare const WIDGET_TIMEFRAME_FAVORITES: TimeFrame[];
|
|
6
|
+
/** "1m", "1H", "1D", "1W"; minutes and months keep their case ("1m" vs "1M"). */
|
|
7
|
+
export declare function timeframeLabel(tf: TimeFrame): string;
|
|
8
|
+
/**
|
|
9
|
+
* The timeframes to offer, shortest first: the widget's own list (or the
|
|
10
|
+
* default menu), less any that the chart's `features.timeframes` whitelist
|
|
11
|
+
* leaves out.
|
|
12
|
+
*/
|
|
13
|
+
export declare function availableTimeframes(widgetList?: TimeFrame[], whitelist?: TimeFrame[]): TimeFrame[];
|
|
14
|
+
/**
|
|
15
|
+
* The toolbar's first favourites: the host's defaults; else, when the host
|
|
16
|
+
* chose the list, all of it (so a short custom list shows as before); else
|
|
17
|
+
* the standard set; else the first few offered.
|
|
18
|
+
*/
|
|
19
|
+
export declare function initialTimeframeFavorites(available: TimeFrame[], hostDefaults?: TimeFrame[], hostChoseList?: boolean): TimeFrame[];
|
|
20
|
+
/**
|
|
21
|
+
* A typed interval as a timeframe, or null: a whole count and an optional
|
|
22
|
+
* unit (`7`, `7m`, `2H`, `3d`, `1W`, `2M`; minutes when the unit is left
|
|
23
|
+
* out). Written in its largest whole unit, so `60` and `1h` are the same.
|
|
24
|
+
*/
|
|
25
|
+
export declare function parseTimeframeInput(text: string): TimeFrame | null;
|
|
26
|
+
/** `list` plus `extra`, without repeats, leaving out what the whitelist excludes, shortest first. */
|
|
27
|
+
export declare function withExtraTimeframes(list: TimeFrame[], extra: TimeFrame[], whitelist?: TimeFrame[]): TimeFrame[];
|
|
28
|
+
//# sourceMappingURL=widgetTimeframes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"widgetTimeframes.d.ts","sourceRoot":"","sources":["../../src/widget/widgetTimeframes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAGtD,kEAAkE;AAClE,eAAO,MAAM,iBAAiB,EAAE,SAAS,EAAyE,CAAC;AAEnH,iDAAiD;AACjD,eAAO,MAAM,0BAA0B,EAAE,SAAS,EAA0C,CAAC;AAI7F,iFAAiF;AACjF,wBAAgB,cAAc,CAAC,EAAE,EAAE,SAAS,GAAG,MAAM,CAGpD;AAYD;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,CAAC,EAAE,SAAS,EAAE,EAAE,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,SAAS,EAAE,CAMlG;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,SAAS,EAAE,EACtB,YAAY,CAAC,EAAE,SAAS,EAAE,EAC1B,aAAa,UAAQ,GACpB,SAAS,EAAE,CAKb;AAaD;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAkBlE;AAED,qGAAqG;AACrG,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,SAAS,EAAE,CAI/G"}
|