react-klinecharts-ui 1.0.0 → 1.1.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 +179 -0
- package/dist/chart.cjs +70 -0
- package/dist/chart.cjs.map +1 -0
- package/dist/chart.d.cts +45 -0
- package/dist/chart.d.ts +45 -0
- package/dist/chart.js +68 -0
- package/dist/chart.js.map +1 -0
- package/dist/chunk-F24D6PWY.cjs +98 -0
- package/dist/chunk-F24D6PWY.cjs.map +1 -0
- package/dist/chunk-O7E57I66.js +92 -0
- package/dist/chunk-O7E57I66.js.map +1 -0
- package/dist/chunk-PZ5AY32C.js +9 -0
- package/dist/chunk-PZ5AY32C.js.map +1 -0
- package/dist/chunk-Q7SFCCGT.cjs +11 -0
- package/dist/chunk-Q7SFCCGT.cjs.map +1 -0
- package/dist/{chunk-JD4NBJ5F.js → chunk-RIT2LJQT.js} +4 -9
- package/dist/chunk-RIT2LJQT.js.map +1 -0
- package/dist/{chunk-LGYYJ2GP.cjs → chunk-SZDU2D3D.cjs} +5 -10
- package/dist/chunk-SZDU2D3D.cjs.map +1 -0
- package/dist/extensions.cjs +10 -9
- package/dist/extensions.js +2 -1
- package/dist/index.cjs +459 -211
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +233 -7
- package/dist/index.d.ts +233 -7
- package/dist/index.js +361 -132
- package/dist/index.js.map +1 -1
- package/package.json +19 -2
- package/dist/chunk-JD4NBJ5F.js.map +0 -1
- package/dist/chunk-LGYYJ2GP.cjs.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -22,12 +22,36 @@ declare const DEFAULT_PERIODS: TerminalPeriod[];
|
|
|
22
22
|
*/
|
|
23
23
|
|
|
24
24
|
type AlertCondition = "crossing_up" | "crossing_down" | "crossing";
|
|
25
|
+
/**
|
|
26
|
+
* What an alert watches. Defaults to a price level on the main symbol; an
|
|
27
|
+
* `indicator` target watches a specific figure series value (e.g. RSI
|
|
28
|
+
* crossing 70, MACD signal crossover).
|
|
29
|
+
*/
|
|
30
|
+
type AlertTarget = {
|
|
31
|
+
type: "price";
|
|
32
|
+
} | {
|
|
33
|
+
type: "indicator";
|
|
34
|
+
/** Indicator id as registered with klinecharts (e.g. `sub_RSI_TV`). */
|
|
35
|
+
indicatorId: string;
|
|
36
|
+
/** Figure key whose value is compared (e.g. `rsi`, `macd`, `signal`). */
|
|
37
|
+
figureKey: string;
|
|
38
|
+
};
|
|
25
39
|
interface Alert {
|
|
26
40
|
id: string;
|
|
41
|
+
/**
|
|
42
|
+
* The threshold the target is compared against. For a `price` target this is
|
|
43
|
+
* a price level; for an `indicator` target it is the indicator value to
|
|
44
|
+
* cross (e.g. 70 for RSI overbought).
|
|
45
|
+
*/
|
|
27
46
|
price: number;
|
|
28
47
|
condition: AlertCondition;
|
|
29
48
|
message?: string;
|
|
30
49
|
triggered: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* What the alert watches. Omit / `"price"` for the classic price-crossing
|
|
52
|
+
* behaviour; use `"indicator"` for indicator-value crossing.
|
|
53
|
+
*/
|
|
54
|
+
target?: AlertTarget;
|
|
31
55
|
/**
|
|
32
56
|
* Visual style for the alert line overlay (color, label text, line/mark
|
|
33
57
|
* styling, bell marker). Persisted in the store so it survives undo/redo
|
|
@@ -74,6 +98,77 @@ interface ReplayState {
|
|
|
74
98
|
totalBars: number;
|
|
75
99
|
}
|
|
76
100
|
|
|
101
|
+
/**
|
|
102
|
+
* Web Storage-compatible adapter. Pass `localStorage`, `sessionStorage`, a
|
|
103
|
+
* remote/IndexedDB wrapper, or an in-memory fake.
|
|
104
|
+
*
|
|
105
|
+
* Methods are **synchronous** to match the Web Storage API. For async backends
|
|
106
|
+
* (IndexedDB, fetch-to-server), wrap them in a sync cache that reads from
|
|
107
|
+
* memory and flushes in the background — the adapter contract is sync.
|
|
108
|
+
*/
|
|
109
|
+
interface StorageAdapter {
|
|
110
|
+
getItem(key: string): string | null;
|
|
111
|
+
setItem(key: string, value: string): void;
|
|
112
|
+
removeItem(key: string): void;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Which slices of the provider store are persisted. Defaults to all three.
|
|
116
|
+
*
|
|
117
|
+
* - `"alerts"` — the price-alert list (`state.alerts`, including each alert's
|
|
118
|
+
* `triggered` flag and `extendData`).
|
|
119
|
+
* - `"settings"` — the `useKlinechartsUISettings` object (candle type, colors,
|
|
120
|
+
* axes, grid, tooltips, …).
|
|
121
|
+
* - `"indicators"` — the active main/sub indicator lists, their pane ids,
|
|
122
|
+
* custom Y-axis bindings, and visibility overrides.
|
|
123
|
+
*/
|
|
124
|
+
type StorageNamespace = "alerts" | "settings" | "indicators";
|
|
125
|
+
declare const DEFAULT_STORAGE_NAMESPACES: readonly StorageNamespace[];
|
|
126
|
+
/** Default key prefix; namespaced keys become `${prefix}${namespace}`. */
|
|
127
|
+
declare const DEFAULT_STORAGE_KEY_PREFIX = "rkui:";
|
|
128
|
+
/**
|
|
129
|
+
* Options passed to `<KlinechartsUIProvider storage={...}>`. All fields
|
|
130
|
+
* optional; omitting `storage` entirely disables persistence (the default —
|
|
131
|
+
* backward-compatible with pre-1.1.0 behaviour).
|
|
132
|
+
*/
|
|
133
|
+
interface StorageOptions {
|
|
134
|
+
/**
|
|
135
|
+
* The adapter instance. Defaults to `localStorage` (SSR-safe: a no-op
|
|
136
|
+
* adapter when `localStorage` is undefined, e.g. during server rendering).
|
|
137
|
+
*/
|
|
138
|
+
adapter?: StorageAdapter;
|
|
139
|
+
/** Key prefix. Default `"rkui:"`. */
|
|
140
|
+
keyPrefix?: string;
|
|
141
|
+
/** Which namespaces to persist. Default: all three. */
|
|
142
|
+
namespaces?: readonly StorageNamespace[];
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Resolved storage configuration (adapter + namespaces + prefix), computed
|
|
146
|
+
* once on mount and exposed via the dispatch context so hooks/tests can read
|
|
147
|
+
* and write through the same adapter the provider uses.
|
|
148
|
+
*/
|
|
149
|
+
interface ResolvedStorage {
|
|
150
|
+
adapter: StorageAdapter;
|
|
151
|
+
namespaces: ReadonlySet<StorageNamespace>;
|
|
152
|
+
keyPrefix: string;
|
|
153
|
+
/** Build the storage key for a namespace: `${keyPrefix}${namespace}`. */
|
|
154
|
+
key(namespace: StorageNamespace): string;
|
|
155
|
+
/** Whether a namespace is configured for persistence. */
|
|
156
|
+
persists(namespace: StorageNamespace): boolean;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Resolve `window.localStorage` lazily and SSR-safely. Never throws; falls
|
|
161
|
+
* back to `NOOP_ADAPTER` when the global is absent or access is denied (e.g.
|
|
162
|
+
* cookies disabled in some browsers throw on `localStorage` access).
|
|
163
|
+
*/
|
|
164
|
+
declare function createDefaultStorage(): StorageAdapter;
|
|
165
|
+
/**
|
|
166
|
+
* Turn raw `StorageOptions` into a `ResolvedStorage` with helpers. Called once
|
|
167
|
+
* on mount by the provider; the result is referentially stable for the life
|
|
168
|
+
* of the provider instance.
|
|
169
|
+
*/
|
|
170
|
+
declare function resolveStorage(options: StorageOptions | undefined): ResolvedStorage;
|
|
171
|
+
|
|
77
172
|
/**
|
|
78
173
|
* Explicit partial symbol type — avoids `PickPartial<SymbolInfo, ...>` which
|
|
79
174
|
* degenerates when SymbolInfo has an index signature `[key: string]: unknown`.
|
|
@@ -107,6 +202,17 @@ interface KlinechartsUIOptions {
|
|
|
107
202
|
* These are registered once, alongside the built-in drawing-tool overlays.
|
|
108
203
|
*/
|
|
109
204
|
overlays?: OverlayTemplate[];
|
|
205
|
+
/**
|
|
206
|
+
* Optional persistence configuration. When provided, the provider hydrates
|
|
207
|
+
* the listed namespaces (alerts, settings, indicators) from the adapter on
|
|
208
|
+
* mount and writes them back on every change. Defaults to `localStorage`
|
|
209
|
+
* (SSR-safe). Omit entirely to disable persistence (pre-1.1.0 behaviour).
|
|
210
|
+
*
|
|
211
|
+
* Note: this covers the reducer store only. Per-hook `useState` values
|
|
212
|
+
* (script code, compared symbols, watchlist, annotations) are not yet
|
|
213
|
+
* persisted — see the roadmap.
|
|
214
|
+
*/
|
|
215
|
+
storage?: StorageOptions;
|
|
110
216
|
children: ReactNode;
|
|
111
217
|
/** Called on every dispatched action with the resulting new state and previous state. */
|
|
112
218
|
onStateChange?: (action: KlinechartsUIAction, nextState: KlinechartsUIState, prevState: KlinechartsUIState) => void;
|
|
@@ -247,10 +353,12 @@ interface KlinechartsUIDispatchValue {
|
|
|
247
353
|
/** Ref populated by useUndoRedo; other hooks call it to record actions. */
|
|
248
354
|
undoRedoListenerRef: RefObject<UndoRedoListener | null>;
|
|
249
355
|
/**
|
|
250
|
-
* Listener set
|
|
251
|
-
* crossing poller when an alert fires.
|
|
356
|
+
* Listener set registered via `useAlerts.onAlertTriggered`; invoked by the
|
|
357
|
+
* provider-owned crossing poller when an alert fires. A Set so multiple
|
|
358
|
+
* components (toolbar, status bar, sound trigger) can all observe firings
|
|
359
|
+
* without one overwriting the other. `onAlertTriggered` returns an unsubscribe.
|
|
252
360
|
*/
|
|
253
|
-
|
|
361
|
+
alertTriggeredListenersRef: RefObject<Set<(alert: Alert) => void>>;
|
|
254
362
|
/**
|
|
255
363
|
* Provider-owned replay resources, shared across every `useReplay` instance
|
|
256
364
|
* so there is exactly one playback timer and one data buffer. The hook reads
|
|
@@ -260,13 +368,19 @@ interface KlinechartsUIDispatchValue {
|
|
|
260
368
|
replayIntervalRef: RefObject<ReturnType<typeof setInterval> | null>;
|
|
261
369
|
replaySavedDataRef: RefObject<KLineData[]>;
|
|
262
370
|
replayIndexRef: RefObject<number>;
|
|
371
|
+
/**
|
|
372
|
+
* Resolved persistence configuration, or `null` when the consumer did not
|
|
373
|
+
* pass the `storage` option (persistence disabled — pre-1.1.0 behaviour).
|
|
374
|
+
* Hooks and tests read/write through this so they share one adapter.
|
|
375
|
+
*/
|
|
376
|
+
storage: ResolvedStorage | null;
|
|
263
377
|
}
|
|
264
378
|
/** Combined context value returned by `useKlinechartsUI()`. */
|
|
265
379
|
interface KlinechartsUIContextValue extends KlinechartsUIDispatchValue {
|
|
266
380
|
state: KlinechartsUIState;
|
|
267
381
|
}
|
|
268
382
|
|
|
269
|
-
declare function KlinechartsUIProvider({ datafeed, defaultSymbol, defaultPeriod, defaultTheme, defaultTimezone, defaultMainIndicators, defaultSubIndicators, defaultLocale, periods, styles, registerExtensions: shouldRegister, overlays: extraOverlays, children, onStateChange, onSymbolChange, onPeriodChange, onThemeChange, onTimezoneChange, onMainIndicatorsChange, onSubIndicatorsChange, onSettingsChange, }: KlinechartsUIOptions): ReactElement;
|
|
383
|
+
declare function KlinechartsUIProvider({ datafeed, defaultSymbol, defaultPeriod, defaultTheme, defaultTimezone, defaultMainIndicators, defaultSubIndicators, defaultLocale, periods, styles, registerExtensions: shouldRegister, overlays: extraOverlays, storage: storageOptions, children, onStateChange, onSymbolChange, onPeriodChange, onThemeChange, onTimezoneChange, onMainIndicatorsChange, onSubIndicatorsChange, onSettingsChange, }: KlinechartsUIOptions): ReactElement;
|
|
270
384
|
|
|
271
385
|
declare const KlinechartsUIStateContext: react.Context<KlinechartsUIState | null>;
|
|
272
386
|
declare const KlinechartsUIDispatchContext: react.Context<KlinechartsUIDispatchValue | null>;
|
|
@@ -769,10 +883,18 @@ declare function useCrosshair(): UseCrosshairReturn;
|
|
|
769
883
|
|
|
770
884
|
interface UseAlertsReturn {
|
|
771
885
|
alerts: Alert[];
|
|
772
|
-
addAlert: (price: number, condition: AlertCondition, message?: string, extendData?: AlertLineExtendData
|
|
886
|
+
addAlert: (price: number, condition: AlertCondition, message?: string, extendData?: AlertLineExtendData,
|
|
887
|
+
/** Alert target: price (default) or an indicator figure value. */
|
|
888
|
+
target?: AlertTarget) => string;
|
|
773
889
|
removeAlert: (id: string) => void;
|
|
774
890
|
clearAlerts: () => void;
|
|
775
|
-
|
|
891
|
+
/**
|
|
892
|
+
* Register a callback fired when any alert crosses its target. Returns an
|
|
893
|
+
* unsubscribe function. Multiple components can register simultaneously —
|
|
894
|
+
* every registered listener is invoked on each firing (no longer
|
|
895
|
+
* last-writer-wins).
|
|
896
|
+
*/
|
|
897
|
+
onAlertTriggered: (callback: (alert: Alert) => void) => () => void;
|
|
776
898
|
}
|
|
777
899
|
/**
|
|
778
900
|
* Headless hook for price-crossing alerts.
|
|
@@ -1019,6 +1141,110 @@ declare const TA: {
|
|
|
1019
1141
|
hma: (data: number[], period: number) => (number | null)[];
|
|
1020
1142
|
};
|
|
1021
1143
|
|
|
1144
|
+
/** One chart cell in a workspace grid. */
|
|
1145
|
+
interface ChartCell {
|
|
1146
|
+
/** Stable cell id (used as React key + workspace registry key). */
|
|
1147
|
+
id: string;
|
|
1148
|
+
symbol: PartialSymbolInfo;
|
|
1149
|
+
period: TerminalPeriod;
|
|
1150
|
+
}
|
|
1151
|
+
/** Top-level workspace state. */
|
|
1152
|
+
interface WorkspaceState {
|
|
1153
|
+
/** The chart cells that make up the layout grid. */
|
|
1154
|
+
cells: ChartCell[];
|
|
1155
|
+
/** Currently focused cell (drives keyboard shortcuts etc.). */
|
|
1156
|
+
activeCellId: string | null;
|
|
1157
|
+
}
|
|
1158
|
+
type WorkspaceAction = {
|
|
1159
|
+
type: "SET_CELLS";
|
|
1160
|
+
cells: ChartCell[];
|
|
1161
|
+
} | {
|
|
1162
|
+
type: "ADD_CELL";
|
|
1163
|
+
cell: ChartCell;
|
|
1164
|
+
} | {
|
|
1165
|
+
type: "REMOVE_CELL";
|
|
1166
|
+
id: string;
|
|
1167
|
+
} | {
|
|
1168
|
+
type: "SET_CELL_SYMBOL";
|
|
1169
|
+
id: string;
|
|
1170
|
+
symbol: PartialSymbolInfo;
|
|
1171
|
+
} | {
|
|
1172
|
+
type: "SET_CELL_PERIOD";
|
|
1173
|
+
id: string;
|
|
1174
|
+
period: TerminalPeriod;
|
|
1175
|
+
} | {
|
|
1176
|
+
type: "SET_ACTIVE_CELL";
|
|
1177
|
+
id: string | null;
|
|
1178
|
+
};
|
|
1179
|
+
/** Channels that can be mirrored between charts in the workspace. */
|
|
1180
|
+
type SyncChannel = "crosshair" | "scroll" | "zoom" | "symbol" | "period";
|
|
1181
|
+
/** Default: every channel mirrored (fully-linked workspace). */
|
|
1182
|
+
declare const DEFAULT_SYNC_CONFIG: Record<SyncChannel, boolean>;
|
|
1183
|
+
/** Per-channel enable/disable for chart mirroring. */
|
|
1184
|
+
type SyncConfig = Partial<Record<SyncChannel, boolean>>;
|
|
1185
|
+
/**
|
|
1186
|
+
* The workspace context value. Exposes the reducer state, the dispatch, and a
|
|
1187
|
+
* chart-instance registry that `useChartSync` populates and the sync logic
|
|
1188
|
+
* iterates over. The registry is intentionally a mutable ref (Map) — chart
|
|
1189
|
+
* instances come and go as cells mount/unmount and we don't want a state bump
|
|
1190
|
+
* on every registration.
|
|
1191
|
+
*/
|
|
1192
|
+
interface WorkspaceContextValue {
|
|
1193
|
+
state: WorkspaceState;
|
|
1194
|
+
dispatch: Dispatch<WorkspaceAction>;
|
|
1195
|
+
/** cellId → Chart instance registry. */
|
|
1196
|
+
chartsRef: {
|
|
1197
|
+
current: Map<string, Chart>;
|
|
1198
|
+
};
|
|
1199
|
+
/** Re-entrancy guard so mirroring doesn't feedback-loop. */
|
|
1200
|
+
broadcastingRef: {
|
|
1201
|
+
current: boolean;
|
|
1202
|
+
};
|
|
1203
|
+
/** Resolved sync config (defaults merged in). */
|
|
1204
|
+
sync: Record<SyncChannel, boolean>;
|
|
1205
|
+
}
|
|
1206
|
+
|
|
1207
|
+
interface WorkspaceProviderProps {
|
|
1208
|
+
/** Initial chart cells for the grid. */
|
|
1209
|
+
defaultCells: ChartCell[];
|
|
1210
|
+
/** Per-channel sync enable/disable. Defaults to all channels on. */
|
|
1211
|
+
sync?: SyncConfig;
|
|
1212
|
+
children: ReactNode;
|
|
1213
|
+
}
|
|
1214
|
+
/**
|
|
1215
|
+
* Coordinator above a grid of `<KlinechartsUIProvider>` trees. Holds the
|
|
1216
|
+
* workspace layout state (cells, active cell), a chart-instance registry that
|
|
1217
|
+
* `useChartSync` populates, and the sync configuration. Charts stay isolated
|
|
1218
|
+
* per provider — alerts/replay/drawings are per-cell in this foundation.
|
|
1219
|
+
*/
|
|
1220
|
+
declare function WorkspaceProvider({ defaultCells, sync, children, }: WorkspaceProviderProps): ReactNode;
|
|
1221
|
+
|
|
1222
|
+
/**
|
|
1223
|
+
* Read the workspace context. Throws if used outside a `<WorkspaceProvider>`.
|
|
1224
|
+
*/
|
|
1225
|
+
declare function useWorkspace(): WorkspaceContextValue;
|
|
1226
|
+
|
|
1227
|
+
interface UseChartSyncOptions {
|
|
1228
|
+
/** This cell's id; must match a cell in the workspace state. */
|
|
1229
|
+
cellId: string;
|
|
1230
|
+
}
|
|
1231
|
+
/**
|
|
1232
|
+
* Bridge hook: call this inside a `<KlinechartsUIProvider>` (typically via a
|
|
1233
|
+
* `<ChartSyncBridge cellId={...} />` component). It registers the provider's
|
|
1234
|
+
* chart with the workspace registry and mirrors viewport/crosshair/zoom events
|
|
1235
|
+
* to the other registered charts, and keeps the workspace's notion of this
|
|
1236
|
+
* cell's symbol/period up to date.
|
|
1237
|
+
*
|
|
1238
|
+
* Mirroring uses only the PUBLIC klinecharts API (`executeAction`,
|
|
1239
|
+
* `scrollToTimestamp`, `setBarSpace`), not internal `_chartStore` fields, so it
|
|
1240
|
+
* survives klinecharts version upgrades. A re-entrancy guard
|
|
1241
|
+
* (`broadcastingRef`) prevents feedback loops.
|
|
1242
|
+
*
|
|
1243
|
+
* Limitations: klinecharts has no `setVisibleRange`, so scroll sync aligns the
|
|
1244
|
+
* right edge via `scrollToTimestamp(realTo)` — close but not pixel-exact.
|
|
1245
|
+
*/
|
|
1246
|
+
declare function useChartSync({ cellId }: UseChartSyncOptions): void;
|
|
1247
|
+
|
|
1022
1248
|
declare const arrow: OverlayTemplate;
|
|
1023
1249
|
|
|
1024
1250
|
declare const circle: OverlayTemplate;
|
|
@@ -1097,4 +1323,4 @@ declare const superTrend: IndicatorTemplate;
|
|
|
1097
1323
|
|
|
1098
1324
|
declare const vwap: IndicatorTemplate;
|
|
1099
1325
|
|
|
1100
|
-
export { type AddIndicatorOptions, type Alert, type AlertCondition, AlertLineExtendData, type Annotation, CANDLE_TYPES, COMPARE_RULES, type CandleTypeItem, type CandleTypeOption, type ChartLayoutState, type CompareRule, type CompareSymbol, type CrosshairBarData, DEFAULT_PERIODS, DRAWING_CATEGORIES, type Datafeed, type DrawingCategoryItem, type DrawingTool, type DrawingToolCategory, type DrawingToolItem, type ExportFormat, INDICATOR_PARAMS, type IndicatorDefinition, type IndicatorInfo, type IndicatorParamConfig, type KlinechartsUIAction, type KlinechartsUIContextValue, KlinechartsUIDispatchContext, type KlinechartsUIDispatchValue, type KlinechartsUIOptions, KlinechartsUIProvider, type KlinechartsUISettingsState, type KlinechartsUIState, KlinechartsUIStateContext, type LayoutEntry, MAIN_INDICATORS, type MagnetMode, type MeasurePoint, type MeasureResult, OrderLineExtendData, type OrderLineOptions, PRICE_AXIS_TYPES, type PartialSymbolInfo, type PriceAxisType, type ReplaySpeed, SUB_INDICATORS, type ScriptPlacement, TA, TIMEZONES, TOOLTIP_SHOW_RULES, type TerminalPeriod, type TimezoneItem, type TimezoneOption, type TooltipShowRule, type UndoRedoAction, type UndoRedoActionType, type UseAlertsReturn, type UseAnnotationsReturn, type UseChartAxesReturn, type UseCompareReturn, type UseCrosshairReturn, type UseDataExportReturn, type UseDrawingToolsReturn, type UseFullscreenReturn, type UseHotkeysReturn, type UseIndicatorsReturn, type UseKlinechartsUILoadingReturn, type UseKlinechartsUISettingsReturn, type UseKlinechartsUIThemeReturn, type UseLayoutManagerReturn, type UseMeasureReturn, type UseOrderLinesReturn, type UsePeriodsReturn, type UseReplayReturn, type UseScreenshotReturn, type UseScriptEditorReturn, type UseSymbolSearchReturn, type UseTimezoneReturn, type UseUndoRedoReturn, type UseWatchlistReturn, type WatchlistItem, YAXIS_POSITIONS, type YAxisPosition, abcd, anyWaves, arrow, bollTv, brush, cci, circle, createDataLoader, eightWaves, elliottWave, fibRetracement, fibonacciCircle, fibonacciExtension, fibonacciSegment, fibonacciSpeedResistanceFan, fibonacciSpiral, fiveWaves, gannBox, gannFan, hma, ichimoku, longPosition, maRibbon, macdTv, measure, parallelChannel, parallelogram, pivotPoints, ray, rect, rsiTv, shortPosition, stochastic, superTrend, threeWaves, triangle, useAlerts, useAnnotations, useChartAxes, useCompare, useCrosshair, useDataExport, useDrawingTools, useFullscreen, useHotkeys, useIndicators, useKlinechartsUI, useKlinechartsUILoading, useKlinechartsUISettings, useKlinechartsUITheme, useLayoutManager, useMeasure, useOrderLines, usePeriods, useReplay, useScreenshot, useScriptEditor, useSymbolSearch, useTimezone, useUndoRedo, useWatchlist, vwap, xabcd };
|
|
1326
|
+
export { type AddIndicatorOptions, type Alert, type AlertCondition, AlertLineExtendData, type AlertTarget, type Annotation, CANDLE_TYPES, COMPARE_RULES, type CandleTypeItem, type CandleTypeOption, type ChartCell, type ChartLayoutState, type CompareRule, type CompareSymbol, type CrosshairBarData, DEFAULT_PERIODS, DEFAULT_STORAGE_KEY_PREFIX, DEFAULT_STORAGE_NAMESPACES, DEFAULT_SYNC_CONFIG, DRAWING_CATEGORIES, type Datafeed, type DrawingCategoryItem, type DrawingTool, type DrawingToolCategory, type DrawingToolItem, type ExportFormat, INDICATOR_PARAMS, type IndicatorDefinition, type IndicatorInfo, type IndicatorParamConfig, type KlinechartsUIAction, type KlinechartsUIContextValue, KlinechartsUIDispatchContext, type KlinechartsUIDispatchValue, type KlinechartsUIOptions, KlinechartsUIProvider, type KlinechartsUISettingsState, type KlinechartsUIState, KlinechartsUIStateContext, type LayoutEntry, MAIN_INDICATORS, type MagnetMode, type MeasurePoint, type MeasureResult, OrderLineExtendData, type OrderLineOptions, PRICE_AXIS_TYPES, type PartialSymbolInfo, type PriceAxisType, type ReplaySpeed, type ResolvedStorage, SUB_INDICATORS, type ScriptPlacement, type StorageAdapter, type StorageNamespace, type StorageOptions, type SyncChannel, type SyncConfig, TA, TIMEZONES, TOOLTIP_SHOW_RULES, type TerminalPeriod, type TimezoneItem, type TimezoneOption, type TooltipShowRule, type UndoRedoAction, type UndoRedoActionType, type UseAlertsReturn, type UseAnnotationsReturn, type UseChartAxesReturn, type UseChartSyncOptions, type UseCompareReturn, type UseCrosshairReturn, type UseDataExportReturn, type UseDrawingToolsReturn, type UseFullscreenReturn, type UseHotkeysReturn, type UseIndicatorsReturn, type UseKlinechartsUILoadingReturn, type UseKlinechartsUISettingsReturn, type UseKlinechartsUIThemeReturn, type UseLayoutManagerReturn, type UseMeasureReturn, type UseOrderLinesReturn, type UsePeriodsReturn, type UseReplayReturn, type UseScreenshotReturn, type UseScriptEditorReturn, type UseSymbolSearchReturn, type UseTimezoneReturn, type UseUndoRedoReturn, type UseWatchlistReturn, type WatchlistItem, type WorkspaceAction, type WorkspaceContextValue, WorkspaceProvider, type WorkspaceProviderProps, type WorkspaceState, YAXIS_POSITIONS, type YAxisPosition, abcd, anyWaves, arrow, bollTv, brush, cci, circle, createDataLoader, createDefaultStorage, eightWaves, elliottWave, fibRetracement, fibonacciCircle, fibonacciExtension, fibonacciSegment, fibonacciSpeedResistanceFan, fibonacciSpiral, fiveWaves, gannBox, gannFan, hma, ichimoku, longPosition, maRibbon, macdTv, measure, parallelChannel, parallelogram, pivotPoints, ray, rect, resolveStorage, rsiTv, shortPosition, stochastic, superTrend, threeWaves, triangle, useAlerts, useAnnotations, useChartAxes, useChartSync, useCompare, useCrosshair, useDataExport, useDrawingTools, useFullscreen, useHotkeys, useIndicators, useKlinechartsUI, useKlinechartsUILoading, useKlinechartsUISettings, useKlinechartsUITheme, useLayoutManager, useMeasure, useOrderLines, usePeriods, useReplay, useScreenshot, useScriptEditor, useSymbolSearch, useTimezone, useUndoRedo, useWatchlist, useWorkspace, vwap, xabcd };
|
package/dist/index.d.ts
CHANGED
|
@@ -22,12 +22,36 @@ declare const DEFAULT_PERIODS: TerminalPeriod[];
|
|
|
22
22
|
*/
|
|
23
23
|
|
|
24
24
|
type AlertCondition = "crossing_up" | "crossing_down" | "crossing";
|
|
25
|
+
/**
|
|
26
|
+
* What an alert watches. Defaults to a price level on the main symbol; an
|
|
27
|
+
* `indicator` target watches a specific figure series value (e.g. RSI
|
|
28
|
+
* crossing 70, MACD signal crossover).
|
|
29
|
+
*/
|
|
30
|
+
type AlertTarget = {
|
|
31
|
+
type: "price";
|
|
32
|
+
} | {
|
|
33
|
+
type: "indicator";
|
|
34
|
+
/** Indicator id as registered with klinecharts (e.g. `sub_RSI_TV`). */
|
|
35
|
+
indicatorId: string;
|
|
36
|
+
/** Figure key whose value is compared (e.g. `rsi`, `macd`, `signal`). */
|
|
37
|
+
figureKey: string;
|
|
38
|
+
};
|
|
25
39
|
interface Alert {
|
|
26
40
|
id: string;
|
|
41
|
+
/**
|
|
42
|
+
* The threshold the target is compared against. For a `price` target this is
|
|
43
|
+
* a price level; for an `indicator` target it is the indicator value to
|
|
44
|
+
* cross (e.g. 70 for RSI overbought).
|
|
45
|
+
*/
|
|
27
46
|
price: number;
|
|
28
47
|
condition: AlertCondition;
|
|
29
48
|
message?: string;
|
|
30
49
|
triggered: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* What the alert watches. Omit / `"price"` for the classic price-crossing
|
|
52
|
+
* behaviour; use `"indicator"` for indicator-value crossing.
|
|
53
|
+
*/
|
|
54
|
+
target?: AlertTarget;
|
|
31
55
|
/**
|
|
32
56
|
* Visual style for the alert line overlay (color, label text, line/mark
|
|
33
57
|
* styling, bell marker). Persisted in the store so it survives undo/redo
|
|
@@ -74,6 +98,77 @@ interface ReplayState {
|
|
|
74
98
|
totalBars: number;
|
|
75
99
|
}
|
|
76
100
|
|
|
101
|
+
/**
|
|
102
|
+
* Web Storage-compatible adapter. Pass `localStorage`, `sessionStorage`, a
|
|
103
|
+
* remote/IndexedDB wrapper, or an in-memory fake.
|
|
104
|
+
*
|
|
105
|
+
* Methods are **synchronous** to match the Web Storage API. For async backends
|
|
106
|
+
* (IndexedDB, fetch-to-server), wrap them in a sync cache that reads from
|
|
107
|
+
* memory and flushes in the background — the adapter contract is sync.
|
|
108
|
+
*/
|
|
109
|
+
interface StorageAdapter {
|
|
110
|
+
getItem(key: string): string | null;
|
|
111
|
+
setItem(key: string, value: string): void;
|
|
112
|
+
removeItem(key: string): void;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Which slices of the provider store are persisted. Defaults to all three.
|
|
116
|
+
*
|
|
117
|
+
* - `"alerts"` — the price-alert list (`state.alerts`, including each alert's
|
|
118
|
+
* `triggered` flag and `extendData`).
|
|
119
|
+
* - `"settings"` — the `useKlinechartsUISettings` object (candle type, colors,
|
|
120
|
+
* axes, grid, tooltips, …).
|
|
121
|
+
* - `"indicators"` — the active main/sub indicator lists, their pane ids,
|
|
122
|
+
* custom Y-axis bindings, and visibility overrides.
|
|
123
|
+
*/
|
|
124
|
+
type StorageNamespace = "alerts" | "settings" | "indicators";
|
|
125
|
+
declare const DEFAULT_STORAGE_NAMESPACES: readonly StorageNamespace[];
|
|
126
|
+
/** Default key prefix; namespaced keys become `${prefix}${namespace}`. */
|
|
127
|
+
declare const DEFAULT_STORAGE_KEY_PREFIX = "rkui:";
|
|
128
|
+
/**
|
|
129
|
+
* Options passed to `<KlinechartsUIProvider storage={...}>`. All fields
|
|
130
|
+
* optional; omitting `storage` entirely disables persistence (the default —
|
|
131
|
+
* backward-compatible with pre-1.1.0 behaviour).
|
|
132
|
+
*/
|
|
133
|
+
interface StorageOptions {
|
|
134
|
+
/**
|
|
135
|
+
* The adapter instance. Defaults to `localStorage` (SSR-safe: a no-op
|
|
136
|
+
* adapter when `localStorage` is undefined, e.g. during server rendering).
|
|
137
|
+
*/
|
|
138
|
+
adapter?: StorageAdapter;
|
|
139
|
+
/** Key prefix. Default `"rkui:"`. */
|
|
140
|
+
keyPrefix?: string;
|
|
141
|
+
/** Which namespaces to persist. Default: all three. */
|
|
142
|
+
namespaces?: readonly StorageNamespace[];
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Resolved storage configuration (adapter + namespaces + prefix), computed
|
|
146
|
+
* once on mount and exposed via the dispatch context so hooks/tests can read
|
|
147
|
+
* and write through the same adapter the provider uses.
|
|
148
|
+
*/
|
|
149
|
+
interface ResolvedStorage {
|
|
150
|
+
adapter: StorageAdapter;
|
|
151
|
+
namespaces: ReadonlySet<StorageNamespace>;
|
|
152
|
+
keyPrefix: string;
|
|
153
|
+
/** Build the storage key for a namespace: `${keyPrefix}${namespace}`. */
|
|
154
|
+
key(namespace: StorageNamespace): string;
|
|
155
|
+
/** Whether a namespace is configured for persistence. */
|
|
156
|
+
persists(namespace: StorageNamespace): boolean;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Resolve `window.localStorage` lazily and SSR-safely. Never throws; falls
|
|
161
|
+
* back to `NOOP_ADAPTER` when the global is absent or access is denied (e.g.
|
|
162
|
+
* cookies disabled in some browsers throw on `localStorage` access).
|
|
163
|
+
*/
|
|
164
|
+
declare function createDefaultStorage(): StorageAdapter;
|
|
165
|
+
/**
|
|
166
|
+
* Turn raw `StorageOptions` into a `ResolvedStorage` with helpers. Called once
|
|
167
|
+
* on mount by the provider; the result is referentially stable for the life
|
|
168
|
+
* of the provider instance.
|
|
169
|
+
*/
|
|
170
|
+
declare function resolveStorage(options: StorageOptions | undefined): ResolvedStorage;
|
|
171
|
+
|
|
77
172
|
/**
|
|
78
173
|
* Explicit partial symbol type — avoids `PickPartial<SymbolInfo, ...>` which
|
|
79
174
|
* degenerates when SymbolInfo has an index signature `[key: string]: unknown`.
|
|
@@ -107,6 +202,17 @@ interface KlinechartsUIOptions {
|
|
|
107
202
|
* These are registered once, alongside the built-in drawing-tool overlays.
|
|
108
203
|
*/
|
|
109
204
|
overlays?: OverlayTemplate[];
|
|
205
|
+
/**
|
|
206
|
+
* Optional persistence configuration. When provided, the provider hydrates
|
|
207
|
+
* the listed namespaces (alerts, settings, indicators) from the adapter on
|
|
208
|
+
* mount and writes them back on every change. Defaults to `localStorage`
|
|
209
|
+
* (SSR-safe). Omit entirely to disable persistence (pre-1.1.0 behaviour).
|
|
210
|
+
*
|
|
211
|
+
* Note: this covers the reducer store only. Per-hook `useState` values
|
|
212
|
+
* (script code, compared symbols, watchlist, annotations) are not yet
|
|
213
|
+
* persisted — see the roadmap.
|
|
214
|
+
*/
|
|
215
|
+
storage?: StorageOptions;
|
|
110
216
|
children: ReactNode;
|
|
111
217
|
/** Called on every dispatched action with the resulting new state and previous state. */
|
|
112
218
|
onStateChange?: (action: KlinechartsUIAction, nextState: KlinechartsUIState, prevState: KlinechartsUIState) => void;
|
|
@@ -247,10 +353,12 @@ interface KlinechartsUIDispatchValue {
|
|
|
247
353
|
/** Ref populated by useUndoRedo; other hooks call it to record actions. */
|
|
248
354
|
undoRedoListenerRef: RefObject<UndoRedoListener | null>;
|
|
249
355
|
/**
|
|
250
|
-
* Listener set
|
|
251
|
-
* crossing poller when an alert fires.
|
|
356
|
+
* Listener set registered via `useAlerts.onAlertTriggered`; invoked by the
|
|
357
|
+
* provider-owned crossing poller when an alert fires. A Set so multiple
|
|
358
|
+
* components (toolbar, status bar, sound trigger) can all observe firings
|
|
359
|
+
* without one overwriting the other. `onAlertTriggered` returns an unsubscribe.
|
|
252
360
|
*/
|
|
253
|
-
|
|
361
|
+
alertTriggeredListenersRef: RefObject<Set<(alert: Alert) => void>>;
|
|
254
362
|
/**
|
|
255
363
|
* Provider-owned replay resources, shared across every `useReplay` instance
|
|
256
364
|
* so there is exactly one playback timer and one data buffer. The hook reads
|
|
@@ -260,13 +368,19 @@ interface KlinechartsUIDispatchValue {
|
|
|
260
368
|
replayIntervalRef: RefObject<ReturnType<typeof setInterval> | null>;
|
|
261
369
|
replaySavedDataRef: RefObject<KLineData[]>;
|
|
262
370
|
replayIndexRef: RefObject<number>;
|
|
371
|
+
/**
|
|
372
|
+
* Resolved persistence configuration, or `null` when the consumer did not
|
|
373
|
+
* pass the `storage` option (persistence disabled — pre-1.1.0 behaviour).
|
|
374
|
+
* Hooks and tests read/write through this so they share one adapter.
|
|
375
|
+
*/
|
|
376
|
+
storage: ResolvedStorage | null;
|
|
263
377
|
}
|
|
264
378
|
/** Combined context value returned by `useKlinechartsUI()`. */
|
|
265
379
|
interface KlinechartsUIContextValue extends KlinechartsUIDispatchValue {
|
|
266
380
|
state: KlinechartsUIState;
|
|
267
381
|
}
|
|
268
382
|
|
|
269
|
-
declare function KlinechartsUIProvider({ datafeed, defaultSymbol, defaultPeriod, defaultTheme, defaultTimezone, defaultMainIndicators, defaultSubIndicators, defaultLocale, periods, styles, registerExtensions: shouldRegister, overlays: extraOverlays, children, onStateChange, onSymbolChange, onPeriodChange, onThemeChange, onTimezoneChange, onMainIndicatorsChange, onSubIndicatorsChange, onSettingsChange, }: KlinechartsUIOptions): ReactElement;
|
|
383
|
+
declare function KlinechartsUIProvider({ datafeed, defaultSymbol, defaultPeriod, defaultTheme, defaultTimezone, defaultMainIndicators, defaultSubIndicators, defaultLocale, periods, styles, registerExtensions: shouldRegister, overlays: extraOverlays, storage: storageOptions, children, onStateChange, onSymbolChange, onPeriodChange, onThemeChange, onTimezoneChange, onMainIndicatorsChange, onSubIndicatorsChange, onSettingsChange, }: KlinechartsUIOptions): ReactElement;
|
|
270
384
|
|
|
271
385
|
declare const KlinechartsUIStateContext: react.Context<KlinechartsUIState | null>;
|
|
272
386
|
declare const KlinechartsUIDispatchContext: react.Context<KlinechartsUIDispatchValue | null>;
|
|
@@ -769,10 +883,18 @@ declare function useCrosshair(): UseCrosshairReturn;
|
|
|
769
883
|
|
|
770
884
|
interface UseAlertsReturn {
|
|
771
885
|
alerts: Alert[];
|
|
772
|
-
addAlert: (price: number, condition: AlertCondition, message?: string, extendData?: AlertLineExtendData
|
|
886
|
+
addAlert: (price: number, condition: AlertCondition, message?: string, extendData?: AlertLineExtendData,
|
|
887
|
+
/** Alert target: price (default) or an indicator figure value. */
|
|
888
|
+
target?: AlertTarget) => string;
|
|
773
889
|
removeAlert: (id: string) => void;
|
|
774
890
|
clearAlerts: () => void;
|
|
775
|
-
|
|
891
|
+
/**
|
|
892
|
+
* Register a callback fired when any alert crosses its target. Returns an
|
|
893
|
+
* unsubscribe function. Multiple components can register simultaneously —
|
|
894
|
+
* every registered listener is invoked on each firing (no longer
|
|
895
|
+
* last-writer-wins).
|
|
896
|
+
*/
|
|
897
|
+
onAlertTriggered: (callback: (alert: Alert) => void) => () => void;
|
|
776
898
|
}
|
|
777
899
|
/**
|
|
778
900
|
* Headless hook for price-crossing alerts.
|
|
@@ -1019,6 +1141,110 @@ declare const TA: {
|
|
|
1019
1141
|
hma: (data: number[], period: number) => (number | null)[];
|
|
1020
1142
|
};
|
|
1021
1143
|
|
|
1144
|
+
/** One chart cell in a workspace grid. */
|
|
1145
|
+
interface ChartCell {
|
|
1146
|
+
/** Stable cell id (used as React key + workspace registry key). */
|
|
1147
|
+
id: string;
|
|
1148
|
+
symbol: PartialSymbolInfo;
|
|
1149
|
+
period: TerminalPeriod;
|
|
1150
|
+
}
|
|
1151
|
+
/** Top-level workspace state. */
|
|
1152
|
+
interface WorkspaceState {
|
|
1153
|
+
/** The chart cells that make up the layout grid. */
|
|
1154
|
+
cells: ChartCell[];
|
|
1155
|
+
/** Currently focused cell (drives keyboard shortcuts etc.). */
|
|
1156
|
+
activeCellId: string | null;
|
|
1157
|
+
}
|
|
1158
|
+
type WorkspaceAction = {
|
|
1159
|
+
type: "SET_CELLS";
|
|
1160
|
+
cells: ChartCell[];
|
|
1161
|
+
} | {
|
|
1162
|
+
type: "ADD_CELL";
|
|
1163
|
+
cell: ChartCell;
|
|
1164
|
+
} | {
|
|
1165
|
+
type: "REMOVE_CELL";
|
|
1166
|
+
id: string;
|
|
1167
|
+
} | {
|
|
1168
|
+
type: "SET_CELL_SYMBOL";
|
|
1169
|
+
id: string;
|
|
1170
|
+
symbol: PartialSymbolInfo;
|
|
1171
|
+
} | {
|
|
1172
|
+
type: "SET_CELL_PERIOD";
|
|
1173
|
+
id: string;
|
|
1174
|
+
period: TerminalPeriod;
|
|
1175
|
+
} | {
|
|
1176
|
+
type: "SET_ACTIVE_CELL";
|
|
1177
|
+
id: string | null;
|
|
1178
|
+
};
|
|
1179
|
+
/** Channels that can be mirrored between charts in the workspace. */
|
|
1180
|
+
type SyncChannel = "crosshair" | "scroll" | "zoom" | "symbol" | "period";
|
|
1181
|
+
/** Default: every channel mirrored (fully-linked workspace). */
|
|
1182
|
+
declare const DEFAULT_SYNC_CONFIG: Record<SyncChannel, boolean>;
|
|
1183
|
+
/** Per-channel enable/disable for chart mirroring. */
|
|
1184
|
+
type SyncConfig = Partial<Record<SyncChannel, boolean>>;
|
|
1185
|
+
/**
|
|
1186
|
+
* The workspace context value. Exposes the reducer state, the dispatch, and a
|
|
1187
|
+
* chart-instance registry that `useChartSync` populates and the sync logic
|
|
1188
|
+
* iterates over. The registry is intentionally a mutable ref (Map) — chart
|
|
1189
|
+
* instances come and go as cells mount/unmount and we don't want a state bump
|
|
1190
|
+
* on every registration.
|
|
1191
|
+
*/
|
|
1192
|
+
interface WorkspaceContextValue {
|
|
1193
|
+
state: WorkspaceState;
|
|
1194
|
+
dispatch: Dispatch<WorkspaceAction>;
|
|
1195
|
+
/** cellId → Chart instance registry. */
|
|
1196
|
+
chartsRef: {
|
|
1197
|
+
current: Map<string, Chart>;
|
|
1198
|
+
};
|
|
1199
|
+
/** Re-entrancy guard so mirroring doesn't feedback-loop. */
|
|
1200
|
+
broadcastingRef: {
|
|
1201
|
+
current: boolean;
|
|
1202
|
+
};
|
|
1203
|
+
/** Resolved sync config (defaults merged in). */
|
|
1204
|
+
sync: Record<SyncChannel, boolean>;
|
|
1205
|
+
}
|
|
1206
|
+
|
|
1207
|
+
interface WorkspaceProviderProps {
|
|
1208
|
+
/** Initial chart cells for the grid. */
|
|
1209
|
+
defaultCells: ChartCell[];
|
|
1210
|
+
/** Per-channel sync enable/disable. Defaults to all channels on. */
|
|
1211
|
+
sync?: SyncConfig;
|
|
1212
|
+
children: ReactNode;
|
|
1213
|
+
}
|
|
1214
|
+
/**
|
|
1215
|
+
* Coordinator above a grid of `<KlinechartsUIProvider>` trees. Holds the
|
|
1216
|
+
* workspace layout state (cells, active cell), a chart-instance registry that
|
|
1217
|
+
* `useChartSync` populates, and the sync configuration. Charts stay isolated
|
|
1218
|
+
* per provider — alerts/replay/drawings are per-cell in this foundation.
|
|
1219
|
+
*/
|
|
1220
|
+
declare function WorkspaceProvider({ defaultCells, sync, children, }: WorkspaceProviderProps): ReactNode;
|
|
1221
|
+
|
|
1222
|
+
/**
|
|
1223
|
+
* Read the workspace context. Throws if used outside a `<WorkspaceProvider>`.
|
|
1224
|
+
*/
|
|
1225
|
+
declare function useWorkspace(): WorkspaceContextValue;
|
|
1226
|
+
|
|
1227
|
+
interface UseChartSyncOptions {
|
|
1228
|
+
/** This cell's id; must match a cell in the workspace state. */
|
|
1229
|
+
cellId: string;
|
|
1230
|
+
}
|
|
1231
|
+
/**
|
|
1232
|
+
* Bridge hook: call this inside a `<KlinechartsUIProvider>` (typically via a
|
|
1233
|
+
* `<ChartSyncBridge cellId={...} />` component). It registers the provider's
|
|
1234
|
+
* chart with the workspace registry and mirrors viewport/crosshair/zoom events
|
|
1235
|
+
* to the other registered charts, and keeps the workspace's notion of this
|
|
1236
|
+
* cell's symbol/period up to date.
|
|
1237
|
+
*
|
|
1238
|
+
* Mirroring uses only the PUBLIC klinecharts API (`executeAction`,
|
|
1239
|
+
* `scrollToTimestamp`, `setBarSpace`), not internal `_chartStore` fields, so it
|
|
1240
|
+
* survives klinecharts version upgrades. A re-entrancy guard
|
|
1241
|
+
* (`broadcastingRef`) prevents feedback loops.
|
|
1242
|
+
*
|
|
1243
|
+
* Limitations: klinecharts has no `setVisibleRange`, so scroll sync aligns the
|
|
1244
|
+
* right edge via `scrollToTimestamp(realTo)` — close but not pixel-exact.
|
|
1245
|
+
*/
|
|
1246
|
+
declare function useChartSync({ cellId }: UseChartSyncOptions): void;
|
|
1247
|
+
|
|
1022
1248
|
declare const arrow: OverlayTemplate;
|
|
1023
1249
|
|
|
1024
1250
|
declare const circle: OverlayTemplate;
|
|
@@ -1097,4 +1323,4 @@ declare const superTrend: IndicatorTemplate;
|
|
|
1097
1323
|
|
|
1098
1324
|
declare const vwap: IndicatorTemplate;
|
|
1099
1325
|
|
|
1100
|
-
export { type AddIndicatorOptions, type Alert, type AlertCondition, AlertLineExtendData, type Annotation, CANDLE_TYPES, COMPARE_RULES, type CandleTypeItem, type CandleTypeOption, type ChartLayoutState, type CompareRule, type CompareSymbol, type CrosshairBarData, DEFAULT_PERIODS, DRAWING_CATEGORIES, type Datafeed, type DrawingCategoryItem, type DrawingTool, type DrawingToolCategory, type DrawingToolItem, type ExportFormat, INDICATOR_PARAMS, type IndicatorDefinition, type IndicatorInfo, type IndicatorParamConfig, type KlinechartsUIAction, type KlinechartsUIContextValue, KlinechartsUIDispatchContext, type KlinechartsUIDispatchValue, type KlinechartsUIOptions, KlinechartsUIProvider, type KlinechartsUISettingsState, type KlinechartsUIState, KlinechartsUIStateContext, type LayoutEntry, MAIN_INDICATORS, type MagnetMode, type MeasurePoint, type MeasureResult, OrderLineExtendData, type OrderLineOptions, PRICE_AXIS_TYPES, type PartialSymbolInfo, type PriceAxisType, type ReplaySpeed, SUB_INDICATORS, type ScriptPlacement, TA, TIMEZONES, TOOLTIP_SHOW_RULES, type TerminalPeriod, type TimezoneItem, type TimezoneOption, type TooltipShowRule, type UndoRedoAction, type UndoRedoActionType, type UseAlertsReturn, type UseAnnotationsReturn, type UseChartAxesReturn, type UseCompareReturn, type UseCrosshairReturn, type UseDataExportReturn, type UseDrawingToolsReturn, type UseFullscreenReturn, type UseHotkeysReturn, type UseIndicatorsReturn, type UseKlinechartsUILoadingReturn, type UseKlinechartsUISettingsReturn, type UseKlinechartsUIThemeReturn, type UseLayoutManagerReturn, type UseMeasureReturn, type UseOrderLinesReturn, type UsePeriodsReturn, type UseReplayReturn, type UseScreenshotReturn, type UseScriptEditorReturn, type UseSymbolSearchReturn, type UseTimezoneReturn, type UseUndoRedoReturn, type UseWatchlistReturn, type WatchlistItem, YAXIS_POSITIONS, type YAxisPosition, abcd, anyWaves, arrow, bollTv, brush, cci, circle, createDataLoader, eightWaves, elliottWave, fibRetracement, fibonacciCircle, fibonacciExtension, fibonacciSegment, fibonacciSpeedResistanceFan, fibonacciSpiral, fiveWaves, gannBox, gannFan, hma, ichimoku, longPosition, maRibbon, macdTv, measure, parallelChannel, parallelogram, pivotPoints, ray, rect, rsiTv, shortPosition, stochastic, superTrend, threeWaves, triangle, useAlerts, useAnnotations, useChartAxes, useCompare, useCrosshair, useDataExport, useDrawingTools, useFullscreen, useHotkeys, useIndicators, useKlinechartsUI, useKlinechartsUILoading, useKlinechartsUISettings, useKlinechartsUITheme, useLayoutManager, useMeasure, useOrderLines, usePeriods, useReplay, useScreenshot, useScriptEditor, useSymbolSearch, useTimezone, useUndoRedo, useWatchlist, vwap, xabcd };
|
|
1326
|
+
export { type AddIndicatorOptions, type Alert, type AlertCondition, AlertLineExtendData, type AlertTarget, type Annotation, CANDLE_TYPES, COMPARE_RULES, type CandleTypeItem, type CandleTypeOption, type ChartCell, type ChartLayoutState, type CompareRule, type CompareSymbol, type CrosshairBarData, DEFAULT_PERIODS, DEFAULT_STORAGE_KEY_PREFIX, DEFAULT_STORAGE_NAMESPACES, DEFAULT_SYNC_CONFIG, DRAWING_CATEGORIES, type Datafeed, type DrawingCategoryItem, type DrawingTool, type DrawingToolCategory, type DrawingToolItem, type ExportFormat, INDICATOR_PARAMS, type IndicatorDefinition, type IndicatorInfo, type IndicatorParamConfig, type KlinechartsUIAction, type KlinechartsUIContextValue, KlinechartsUIDispatchContext, type KlinechartsUIDispatchValue, type KlinechartsUIOptions, KlinechartsUIProvider, type KlinechartsUISettingsState, type KlinechartsUIState, KlinechartsUIStateContext, type LayoutEntry, MAIN_INDICATORS, type MagnetMode, type MeasurePoint, type MeasureResult, OrderLineExtendData, type OrderLineOptions, PRICE_AXIS_TYPES, type PartialSymbolInfo, type PriceAxisType, type ReplaySpeed, type ResolvedStorage, SUB_INDICATORS, type ScriptPlacement, type StorageAdapter, type StorageNamespace, type StorageOptions, type SyncChannel, type SyncConfig, TA, TIMEZONES, TOOLTIP_SHOW_RULES, type TerminalPeriod, type TimezoneItem, type TimezoneOption, type TooltipShowRule, type UndoRedoAction, type UndoRedoActionType, type UseAlertsReturn, type UseAnnotationsReturn, type UseChartAxesReturn, type UseChartSyncOptions, type UseCompareReturn, type UseCrosshairReturn, type UseDataExportReturn, type UseDrawingToolsReturn, type UseFullscreenReturn, type UseHotkeysReturn, type UseIndicatorsReturn, type UseKlinechartsUILoadingReturn, type UseKlinechartsUISettingsReturn, type UseKlinechartsUIThemeReturn, type UseLayoutManagerReturn, type UseMeasureReturn, type UseOrderLinesReturn, type UsePeriodsReturn, type UseReplayReturn, type UseScreenshotReturn, type UseScriptEditorReturn, type UseSymbolSearchReturn, type UseTimezoneReturn, type UseUndoRedoReturn, type UseWatchlistReturn, type WatchlistItem, type WorkspaceAction, type WorkspaceContextValue, WorkspaceProvider, type WorkspaceProviderProps, type WorkspaceState, YAXIS_POSITIONS, type YAxisPosition, abcd, anyWaves, arrow, bollTv, brush, cci, circle, createDataLoader, createDefaultStorage, eightWaves, elliottWave, fibRetracement, fibonacciCircle, fibonacciExtension, fibonacciSegment, fibonacciSpeedResistanceFan, fibonacciSpiral, fiveWaves, gannBox, gannFan, hma, ichimoku, longPosition, maRibbon, macdTv, measure, parallelChannel, parallelogram, pivotPoints, ray, rect, resolveStorage, rsiTv, shortPosition, stochastic, superTrend, threeWaves, triangle, useAlerts, useAnnotations, useChartAxes, useChartSync, useCompare, useCrosshair, useDataExport, useDrawingTools, useFullscreen, useHotkeys, useIndicators, useKlinechartsUI, useKlinechartsUILoading, useKlinechartsUISettings, useKlinechartsUITheme, useLayoutManager, useMeasure, useOrderLines, usePeriods, useReplay, useScreenshot, useScriptEditor, useSymbolSearch, useTimezone, useUndoRedo, useWatchlist, useWorkspace, vwap, xabcd };
|