react-klinecharts-ui 0.2.0 → 0.3.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/dist/index.d.cts CHANGED
@@ -2,7 +2,7 @@ import * as react from 'react';
2
2
  import { Dispatch, RefObject, ReactNode, ReactElement } from 'react';
3
3
  import { Period, SymbolInfo, KLineData, Chart, DeepPartial, Styles, OverlayTemplate, DataLoader, IndicatorTemplate } from 'react-klinecharts';
4
4
  import { OrderLineExtendData } from './extensions.cjs';
5
- export { OrderLineFontStyle, OrderLineLabelStyle, OrderLineLineStyle, OrderLineMarkStyle, OrderLinePadding, indicators, orderLine, overlays, registerExtensions } from './extensions.cjs';
5
+ export { DepthOverlayExtendData, DepthOverlayRow, OrderLineFontStyle, OrderLineLabelStyle, OrderLineLineStyle, OrderLineMarkStyle, OrderLinePadding, depthOverlay, indicators, orderLine, overlays, registerExtensions } from './extensions.cjs';
6
6
 
7
7
  interface TerminalPeriod extends Period {
8
8
  label: string;
@@ -199,6 +199,14 @@ interface UseIndicatorsReturn {
199
199
  }[];
200
200
  isMainIndicatorActive: (name: string) => boolean;
201
201
  isSubIndicatorActive: (name: string) => boolean;
202
+ /** Collapse a sub-indicator pane to minimal height (30px). */
203
+ collapseSubIndicator: (name: string) => void;
204
+ /** Expand a previously collapsed sub-indicator pane to its prior height. */
205
+ expandSubIndicator: (name: string) => void;
206
+ /** Whether the given sub-indicator pane is currently collapsed. */
207
+ isSubIndicatorCollapsed: (name: string) => boolean;
208
+ /** Reorder a sub-indicator pane up or down relative to other sub-indicators. */
209
+ reorderSubIndicator: (name: string, direction: "up" | "down") => void;
202
210
  }
203
211
  declare function useIndicators(): UseIndicatorsReturn;
204
212
 
@@ -227,12 +235,16 @@ interface UseDrawingToolsReturn {
227
235
  magnetMode: MagnetMode;
228
236
  isLocked: boolean;
229
237
  isVisible: boolean;
238
+ /** Whether drawing tools auto-retrigger after completing a shape. Default: true. */
239
+ autoRetrigger: boolean;
230
240
  selectTool: (name: string) => void;
231
241
  clearActiveTool: () => void;
232
242
  setMagnetMode: (mode: MagnetMode) => void;
233
243
  toggleLock: () => void;
234
244
  toggleVisibility: () => void;
235
245
  removeAllDrawings: () => void;
246
+ /** Enable/disable auto-retrigger mode. */
247
+ setAutoRetrigger: (enabled: boolean) => void;
236
248
  }
237
249
  declare function useDrawingTools(): UseDrawingToolsReturn;
238
250
 
@@ -494,6 +506,182 @@ interface UseScriptEditorReturn {
494
506
  */
495
507
  declare function useScriptEditor(): UseScriptEditorReturn;
496
508
 
509
+ interface CrosshairBarData {
510
+ open: number;
511
+ high: number;
512
+ low: number;
513
+ close: number;
514
+ volume: number;
515
+ timestamp: number;
516
+ change: number;
517
+ changePercent: number;
518
+ }
519
+ interface UseCrosshairReturn {
520
+ /** OHLCV data of the bar under the crosshair. Null when cursor is off-chart. */
521
+ barData: CrosshairBarData | null;
522
+ }
523
+ declare function useCrosshair(): UseCrosshairReturn;
524
+
525
+ type AlertCondition = "crossing_up" | "crossing_down" | "crossing";
526
+ interface Alert {
527
+ id: string;
528
+ price: number;
529
+ condition: AlertCondition;
530
+ message?: string;
531
+ triggered: boolean;
532
+ }
533
+ interface UseAlertsReturn {
534
+ alerts: Alert[];
535
+ addAlert: (price: number, condition: AlertCondition, message?: string) => string;
536
+ removeAlert: (id: string) => void;
537
+ clearAlerts: () => void;
538
+ onAlertTriggered: (callback: (alert: Alert) => void) => void;
539
+ }
540
+ declare function useAlerts(): UseAlertsReturn;
541
+
542
+ type ExportFormat = "csv" | "json";
543
+ interface UseDataExportReturn {
544
+ /** Export all chart data */
545
+ exportAll: (format: ExportFormat) => void;
546
+ /** Export only the visible range */
547
+ exportVisible: (format: ExportFormat) => void;
548
+ }
549
+ declare function useDataExport(): UseDataExportReturn;
550
+
551
+ interface WatchlistItem {
552
+ ticker: string;
553
+ lastPrice: number | null;
554
+ change: number | null;
555
+ changePercent: number | null;
556
+ }
557
+ interface UseWatchlistReturn {
558
+ items: WatchlistItem[];
559
+ addSymbol: (ticker: string) => void;
560
+ removeSymbol: (ticker: string) => void;
561
+ switchSymbol: (ticker: string) => void;
562
+ activeSymbol: string | null;
563
+ }
564
+ declare function useWatchlist(): UseWatchlistReturn;
565
+
566
+ type ReplaySpeed = 1 | 2 | 5 | 10;
567
+ interface UseReplayReturn {
568
+ /** Whether a replay session is active */
569
+ isReplaying: boolean;
570
+ /** Whether the replay is currently paused */
571
+ isPaused: boolean;
572
+ /** Current playback speed multiplier */
573
+ speed: ReplaySpeed;
574
+ /** Current bar index in the replay */
575
+ barIndex: number;
576
+ /** Total number of bars in the saved data */
577
+ totalBars: number;
578
+ /** Start replaying from the beginning */
579
+ startReplay: () => void;
580
+ /** Stop replay and restore original data */
581
+ stopReplay: () => void;
582
+ /** Toggle play/pause */
583
+ togglePause: () => void;
584
+ /** Advance one bar while paused */
585
+ stepForward: () => void;
586
+ /** Go back one bar while paused */
587
+ stepBackward: () => void;
588
+ /** Seek to a specific bar index (0-based). Pauses playback. */
589
+ seekTo: (index: number) => void;
590
+ /** Change the playback speed */
591
+ setSpeed: (speed: ReplaySpeed) => void;
592
+ }
593
+ /**
594
+ * Headless hook for historical data replay (bar-by-bar playback).
595
+ *
596
+ * Loads the current chart data, clears the chart, then progressively adds
597
+ * bars back one at a time at the configured speed. Useful for backtesting
598
+ * and reviewing price action.
599
+ */
600
+ declare function useReplay(): UseReplayReturn;
601
+
602
+ interface CompareSymbol {
603
+ ticker: string;
604
+ /** Base price (first bar close) used for percentage normalization */
605
+ basePrice: number | null;
606
+ color: string;
607
+ visible: boolean;
608
+ }
609
+ interface UseCompareReturn {
610
+ /** Currently compared symbols */
611
+ symbols: CompareSymbol[];
612
+ /** Add a symbol — fetches data, normalizes to %, renders as indicator line */
613
+ addSymbol: (ticker: string, color?: string) => Promise<void>;
614
+ /** Remove a symbol overlay */
615
+ removeSymbol: (ticker: string) => void;
616
+ /** Toggle visibility of a compared symbol */
617
+ toggleSymbol: (ticker: string) => void;
618
+ /** Clear all comparisons */
619
+ clearAll: () => void;
620
+ }
621
+ /**
622
+ * Headless hook for comparing multiple symbols on the same chart.
623
+ *
624
+ * Fetches historical data for each added symbol via the datafeed,
625
+ * normalizes prices to percentage change from the first bar,
626
+ * and renders each as a custom indicator line on the main pane.
627
+ */
628
+ declare function useCompare(): UseCompareReturn;
629
+
630
+ interface MeasurePoint {
631
+ price: number;
632
+ timestamp: number;
633
+ barIndex: number;
634
+ }
635
+ interface MeasureResult {
636
+ from: MeasurePoint;
637
+ to: MeasurePoint;
638
+ /** Absolute price difference */
639
+ priceDiff: number;
640
+ /** Percentage change from → to */
641
+ pricePercent: number;
642
+ /** Number of bars between the two points */
643
+ bars: number;
644
+ /** Time difference in milliseconds */
645
+ timeDiff: number;
646
+ }
647
+ interface UseMeasureReturn {
648
+ /** Whether measure mode is active (waiting for clicks) */
649
+ isActive: boolean;
650
+ /** Start measure mode — next two clicks on chart set from/to */
651
+ startMeasure: () => void;
652
+ /** Cancel measure mode */
653
+ cancelMeasure: () => void;
654
+ /** Current measurement result (null until both points are set) */
655
+ result: MeasureResult | null;
656
+ /** Clear the current measurement */
657
+ clearResult: () => void;
658
+ /** First point (set after first click) */
659
+ fromPoint: MeasurePoint | null;
660
+ }
661
+ /**
662
+ * Headless hook for measuring distance/time/percentage between two points.
663
+ *
664
+ * Activates measure mode, captures two clicks on the chart via overlay
665
+ * interaction, then computes price diff, %, bar count, and time diff.
666
+ */
667
+ declare function useMeasure(): UseMeasureReturn;
668
+
669
+ interface Annotation {
670
+ id: string;
671
+ text: string;
672
+ price: number;
673
+ timestamp: number;
674
+ color?: string;
675
+ }
676
+ interface UseAnnotationsReturn {
677
+ annotations: Annotation[];
678
+ addAnnotation: (text: string, price: number, timestamp: number, color?: string) => string;
679
+ removeAnnotation: (id: string) => void;
680
+ updateAnnotation: (id: string, updates: Partial<Pick<Annotation, "text" | "color">>) => void;
681
+ clearAnnotations: () => void;
682
+ }
683
+ declare function useAnnotations(): UseAnnotationsReturn;
684
+
497
685
  interface TimezoneOption {
498
686
  key: string;
499
687
  localeKey: string;
@@ -673,4 +861,4 @@ declare const superTrend: IndicatorTemplate;
673
861
 
674
862
  declare const vwap: IndicatorTemplate;
675
863
 
676
- export { CANDLE_TYPES, COMPARE_RULES, type CandleTypeItem, type CandleTypeOption, type ChartLayoutState, type CompareRule, DEFAULT_PERIODS, DRAWING_CATEGORIES, type Datafeed, type DrawingCategoryItem, type DrawingTool, type DrawingToolCategory, type DrawingToolItem, 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, OrderLineExtendData, type OrderLineOptions, PRICE_AXIS_TYPES, type PartialSymbolInfo, type PriceAxisType, SUB_INDICATORS, type ScriptPlacement, TA, TIMEZONES, TOOLTIP_SHOW_RULES, type TerminalPeriod, type TimezoneItem, type TimezoneOption, type TooltipShowRule, type UndoRedoAction, type UndoRedoActionType, type UseDrawingToolsReturn, type UseFullscreenReturn, type UseIndicatorsReturn, type UseKlinechartsUILoadingReturn, type UseKlinechartsUISettingsReturn, type UseKlinechartsUIThemeReturn, type UseLayoutManagerReturn, type UseOrderLinesReturn, type UsePeriodsReturn, type UseScreenshotReturn, type UseScriptEditorReturn, type UseSymbolSearchReturn, type UseTimezoneReturn, type UseUndoRedoReturn, 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, useDrawingTools, useFullscreen, useIndicators, useKlinechartsUI, useKlinechartsUILoading, useKlinechartsUISettings, useKlinechartsUITheme, useLayoutManager, useOrderLines, usePeriods, useScreenshot, useScriptEditor, useSymbolSearch, useTimezone, useUndoRedo, vwap, xabcd };
864
+ export { type Alert, type AlertCondition, 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 UseCompareReturn, type UseCrosshairReturn, type UseDataExportReturn, type UseDrawingToolsReturn, type UseFullscreenReturn, 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, useCompare, useCrosshair, useDataExport, useDrawingTools, useFullscreen, useIndicators, useKlinechartsUI, useKlinechartsUILoading, useKlinechartsUISettings, useKlinechartsUITheme, useLayoutManager, useMeasure, useOrderLines, usePeriods, useReplay, useScreenshot, useScriptEditor, useSymbolSearch, useTimezone, useUndoRedo, useWatchlist, vwap, xabcd };
package/dist/index.d.ts CHANGED
@@ -2,7 +2,7 @@ import * as react from 'react';
2
2
  import { Dispatch, RefObject, ReactNode, ReactElement } from 'react';
3
3
  import { Period, SymbolInfo, KLineData, Chart, DeepPartial, Styles, OverlayTemplate, DataLoader, IndicatorTemplate } from 'react-klinecharts';
4
4
  import { OrderLineExtendData } from './extensions.js';
5
- export { OrderLineFontStyle, OrderLineLabelStyle, OrderLineLineStyle, OrderLineMarkStyle, OrderLinePadding, indicators, orderLine, overlays, registerExtensions } from './extensions.js';
5
+ export { DepthOverlayExtendData, DepthOverlayRow, OrderLineFontStyle, OrderLineLabelStyle, OrderLineLineStyle, OrderLineMarkStyle, OrderLinePadding, depthOverlay, indicators, orderLine, overlays, registerExtensions } from './extensions.js';
6
6
 
7
7
  interface TerminalPeriod extends Period {
8
8
  label: string;
@@ -199,6 +199,14 @@ interface UseIndicatorsReturn {
199
199
  }[];
200
200
  isMainIndicatorActive: (name: string) => boolean;
201
201
  isSubIndicatorActive: (name: string) => boolean;
202
+ /** Collapse a sub-indicator pane to minimal height (30px). */
203
+ collapseSubIndicator: (name: string) => void;
204
+ /** Expand a previously collapsed sub-indicator pane to its prior height. */
205
+ expandSubIndicator: (name: string) => void;
206
+ /** Whether the given sub-indicator pane is currently collapsed. */
207
+ isSubIndicatorCollapsed: (name: string) => boolean;
208
+ /** Reorder a sub-indicator pane up or down relative to other sub-indicators. */
209
+ reorderSubIndicator: (name: string, direction: "up" | "down") => void;
202
210
  }
203
211
  declare function useIndicators(): UseIndicatorsReturn;
204
212
 
@@ -227,12 +235,16 @@ interface UseDrawingToolsReturn {
227
235
  magnetMode: MagnetMode;
228
236
  isLocked: boolean;
229
237
  isVisible: boolean;
238
+ /** Whether drawing tools auto-retrigger after completing a shape. Default: true. */
239
+ autoRetrigger: boolean;
230
240
  selectTool: (name: string) => void;
231
241
  clearActiveTool: () => void;
232
242
  setMagnetMode: (mode: MagnetMode) => void;
233
243
  toggleLock: () => void;
234
244
  toggleVisibility: () => void;
235
245
  removeAllDrawings: () => void;
246
+ /** Enable/disable auto-retrigger mode. */
247
+ setAutoRetrigger: (enabled: boolean) => void;
236
248
  }
237
249
  declare function useDrawingTools(): UseDrawingToolsReturn;
238
250
 
@@ -494,6 +506,182 @@ interface UseScriptEditorReturn {
494
506
  */
495
507
  declare function useScriptEditor(): UseScriptEditorReturn;
496
508
 
509
+ interface CrosshairBarData {
510
+ open: number;
511
+ high: number;
512
+ low: number;
513
+ close: number;
514
+ volume: number;
515
+ timestamp: number;
516
+ change: number;
517
+ changePercent: number;
518
+ }
519
+ interface UseCrosshairReturn {
520
+ /** OHLCV data of the bar under the crosshair. Null when cursor is off-chart. */
521
+ barData: CrosshairBarData | null;
522
+ }
523
+ declare function useCrosshair(): UseCrosshairReturn;
524
+
525
+ type AlertCondition = "crossing_up" | "crossing_down" | "crossing";
526
+ interface Alert {
527
+ id: string;
528
+ price: number;
529
+ condition: AlertCondition;
530
+ message?: string;
531
+ triggered: boolean;
532
+ }
533
+ interface UseAlertsReturn {
534
+ alerts: Alert[];
535
+ addAlert: (price: number, condition: AlertCondition, message?: string) => string;
536
+ removeAlert: (id: string) => void;
537
+ clearAlerts: () => void;
538
+ onAlertTriggered: (callback: (alert: Alert) => void) => void;
539
+ }
540
+ declare function useAlerts(): UseAlertsReturn;
541
+
542
+ type ExportFormat = "csv" | "json";
543
+ interface UseDataExportReturn {
544
+ /** Export all chart data */
545
+ exportAll: (format: ExportFormat) => void;
546
+ /** Export only the visible range */
547
+ exportVisible: (format: ExportFormat) => void;
548
+ }
549
+ declare function useDataExport(): UseDataExportReturn;
550
+
551
+ interface WatchlistItem {
552
+ ticker: string;
553
+ lastPrice: number | null;
554
+ change: number | null;
555
+ changePercent: number | null;
556
+ }
557
+ interface UseWatchlistReturn {
558
+ items: WatchlistItem[];
559
+ addSymbol: (ticker: string) => void;
560
+ removeSymbol: (ticker: string) => void;
561
+ switchSymbol: (ticker: string) => void;
562
+ activeSymbol: string | null;
563
+ }
564
+ declare function useWatchlist(): UseWatchlistReturn;
565
+
566
+ type ReplaySpeed = 1 | 2 | 5 | 10;
567
+ interface UseReplayReturn {
568
+ /** Whether a replay session is active */
569
+ isReplaying: boolean;
570
+ /** Whether the replay is currently paused */
571
+ isPaused: boolean;
572
+ /** Current playback speed multiplier */
573
+ speed: ReplaySpeed;
574
+ /** Current bar index in the replay */
575
+ barIndex: number;
576
+ /** Total number of bars in the saved data */
577
+ totalBars: number;
578
+ /** Start replaying from the beginning */
579
+ startReplay: () => void;
580
+ /** Stop replay and restore original data */
581
+ stopReplay: () => void;
582
+ /** Toggle play/pause */
583
+ togglePause: () => void;
584
+ /** Advance one bar while paused */
585
+ stepForward: () => void;
586
+ /** Go back one bar while paused */
587
+ stepBackward: () => void;
588
+ /** Seek to a specific bar index (0-based). Pauses playback. */
589
+ seekTo: (index: number) => void;
590
+ /** Change the playback speed */
591
+ setSpeed: (speed: ReplaySpeed) => void;
592
+ }
593
+ /**
594
+ * Headless hook for historical data replay (bar-by-bar playback).
595
+ *
596
+ * Loads the current chart data, clears the chart, then progressively adds
597
+ * bars back one at a time at the configured speed. Useful for backtesting
598
+ * and reviewing price action.
599
+ */
600
+ declare function useReplay(): UseReplayReturn;
601
+
602
+ interface CompareSymbol {
603
+ ticker: string;
604
+ /** Base price (first bar close) used for percentage normalization */
605
+ basePrice: number | null;
606
+ color: string;
607
+ visible: boolean;
608
+ }
609
+ interface UseCompareReturn {
610
+ /** Currently compared symbols */
611
+ symbols: CompareSymbol[];
612
+ /** Add a symbol — fetches data, normalizes to %, renders as indicator line */
613
+ addSymbol: (ticker: string, color?: string) => Promise<void>;
614
+ /** Remove a symbol overlay */
615
+ removeSymbol: (ticker: string) => void;
616
+ /** Toggle visibility of a compared symbol */
617
+ toggleSymbol: (ticker: string) => void;
618
+ /** Clear all comparisons */
619
+ clearAll: () => void;
620
+ }
621
+ /**
622
+ * Headless hook for comparing multiple symbols on the same chart.
623
+ *
624
+ * Fetches historical data for each added symbol via the datafeed,
625
+ * normalizes prices to percentage change from the first bar,
626
+ * and renders each as a custom indicator line on the main pane.
627
+ */
628
+ declare function useCompare(): UseCompareReturn;
629
+
630
+ interface MeasurePoint {
631
+ price: number;
632
+ timestamp: number;
633
+ barIndex: number;
634
+ }
635
+ interface MeasureResult {
636
+ from: MeasurePoint;
637
+ to: MeasurePoint;
638
+ /** Absolute price difference */
639
+ priceDiff: number;
640
+ /** Percentage change from → to */
641
+ pricePercent: number;
642
+ /** Number of bars between the two points */
643
+ bars: number;
644
+ /** Time difference in milliseconds */
645
+ timeDiff: number;
646
+ }
647
+ interface UseMeasureReturn {
648
+ /** Whether measure mode is active (waiting for clicks) */
649
+ isActive: boolean;
650
+ /** Start measure mode — next two clicks on chart set from/to */
651
+ startMeasure: () => void;
652
+ /** Cancel measure mode */
653
+ cancelMeasure: () => void;
654
+ /** Current measurement result (null until both points are set) */
655
+ result: MeasureResult | null;
656
+ /** Clear the current measurement */
657
+ clearResult: () => void;
658
+ /** First point (set after first click) */
659
+ fromPoint: MeasurePoint | null;
660
+ }
661
+ /**
662
+ * Headless hook for measuring distance/time/percentage between two points.
663
+ *
664
+ * Activates measure mode, captures two clicks on the chart via overlay
665
+ * interaction, then computes price diff, %, bar count, and time diff.
666
+ */
667
+ declare function useMeasure(): UseMeasureReturn;
668
+
669
+ interface Annotation {
670
+ id: string;
671
+ text: string;
672
+ price: number;
673
+ timestamp: number;
674
+ color?: string;
675
+ }
676
+ interface UseAnnotationsReturn {
677
+ annotations: Annotation[];
678
+ addAnnotation: (text: string, price: number, timestamp: number, color?: string) => string;
679
+ removeAnnotation: (id: string) => void;
680
+ updateAnnotation: (id: string, updates: Partial<Pick<Annotation, "text" | "color">>) => void;
681
+ clearAnnotations: () => void;
682
+ }
683
+ declare function useAnnotations(): UseAnnotationsReturn;
684
+
497
685
  interface TimezoneOption {
498
686
  key: string;
499
687
  localeKey: string;
@@ -673,4 +861,4 @@ declare const superTrend: IndicatorTemplate;
673
861
 
674
862
  declare const vwap: IndicatorTemplate;
675
863
 
676
- export { CANDLE_TYPES, COMPARE_RULES, type CandleTypeItem, type CandleTypeOption, type ChartLayoutState, type CompareRule, DEFAULT_PERIODS, DRAWING_CATEGORIES, type Datafeed, type DrawingCategoryItem, type DrawingTool, type DrawingToolCategory, type DrawingToolItem, 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, OrderLineExtendData, type OrderLineOptions, PRICE_AXIS_TYPES, type PartialSymbolInfo, type PriceAxisType, SUB_INDICATORS, type ScriptPlacement, TA, TIMEZONES, TOOLTIP_SHOW_RULES, type TerminalPeriod, type TimezoneItem, type TimezoneOption, type TooltipShowRule, type UndoRedoAction, type UndoRedoActionType, type UseDrawingToolsReturn, type UseFullscreenReturn, type UseIndicatorsReturn, type UseKlinechartsUILoadingReturn, type UseKlinechartsUISettingsReturn, type UseKlinechartsUIThemeReturn, type UseLayoutManagerReturn, type UseOrderLinesReturn, type UsePeriodsReturn, type UseScreenshotReturn, type UseScriptEditorReturn, type UseSymbolSearchReturn, type UseTimezoneReturn, type UseUndoRedoReturn, 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, useDrawingTools, useFullscreen, useIndicators, useKlinechartsUI, useKlinechartsUILoading, useKlinechartsUISettings, useKlinechartsUITheme, useLayoutManager, useOrderLines, usePeriods, useScreenshot, useScriptEditor, useSymbolSearch, useTimezone, useUndoRedo, vwap, xabcd };
864
+ export { type Alert, type AlertCondition, 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 UseCompareReturn, type UseCrosshairReturn, type UseDataExportReturn, type UseDrawingToolsReturn, type UseFullscreenReturn, 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, useCompare, useCrosshair, useDataExport, useDrawingTools, useFullscreen, useIndicators, useKlinechartsUI, useKlinechartsUILoading, useKlinechartsUISettings, useKlinechartsUITheme, useLayoutManager, useMeasure, useOrderLines, usePeriods, useReplay, useScreenshot, useScriptEditor, useSymbolSearch, useTimezone, useUndoRedo, useWatchlist, vwap, xabcd };