lightweight-charts-react-components 1.4.1 → 2.0.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.ts CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  /**!
3
- * lightweight-charts-react-components v1.4.1
3
+ * lightweight-charts-react-components v2.0.0
4
4
  *
5
5
  * This source code is licensed under the MIT license found in the
6
6
  * LICENSE.md file in the root directory of this source tree.
@@ -9,12 +9,15 @@
9
9
  */
10
10
 
11
11
  import { ChartOptions } from 'lightweight-charts';
12
+ import { ChartOptionsImpl } from 'lightweight-charts';
12
13
  import { DeepPartial } from 'lightweight-charts';
13
14
  import type { DependencyList } from 'react';
14
15
  import type { ForwardedRef } from 'react';
15
16
  import type { ForwardRefExoticComponent } from 'react';
16
17
  import { IChartApi } from 'lightweight-charts';
18
+ import { IChartApiBase } from 'lightweight-charts';
17
19
  import type { ICustomSeriesPaneView } from 'lightweight-charts';
20
+ import { IHorzScaleBehavior } from 'lightweight-charts';
18
21
  import type { IImageWatermarkPluginApi } from 'lightweight-charts';
19
22
  import type { ImageWatermarkOptions } from 'lightweight-charts';
20
23
  import type { IPaneApi } from 'lightweight-charts';
@@ -26,11 +29,14 @@ import type { ISeriesMarkersPluginApi } from 'lightweight-charts';
26
29
  import type { ISeriesPrimitive } from 'lightweight-charts';
27
30
  import type { ITextWatermarkPluginApi } from 'lightweight-charts';
28
31
  import type { ITimeScaleApi } from 'lightweight-charts';
32
+ import { IYieldCurveChartApi } from 'lightweight-charts';
29
33
  import type { JSX } from 'react';
30
34
  import type { LogicalRangeChangeEventHandler } from 'lightweight-charts';
31
35
  import { MouseEventHandler } from 'lightweight-charts';
36
+ import { PriceChartOptions } from 'lightweight-charts';
32
37
  import type { PriceLineOptions } from 'lightweight-charts';
33
38
  import type { PriceScaleOptions as PriceScaleOptions_2 } from 'lightweight-charts';
39
+ import type { ReactElement } from 'react';
34
40
  import type { ReactNode } from 'react';
35
41
  import type { RefAttributes } from 'react';
36
42
  import type { SeriesDataItemTypeMap } from 'lightweight-charts';
@@ -43,6 +49,7 @@ import type { TextWatermarkOptions } from 'lightweight-charts';
43
49
  import { Time } from 'lightweight-charts';
44
50
  import type { TimeRangeChangeEventHandler } from 'lightweight-charts';
45
51
  import type { TimeScaleOptions as TimeScaleOptions_2 } from 'lightweight-charts';
52
+ import { YieldCurveChartOptions } from 'lightweight-charts';
46
53
 
47
54
  /**
48
55
  * AreaSeries component that can be used to create an area series in a chart.
@@ -147,22 +154,27 @@ export declare const CandlestickSeries: SeriesForwardRefComponent<"Candlestick">
147
154
  */
148
155
  export declare const Chart: ForwardRefExoticComponent<ChartProps & RefAttributes<HTMLDivElement>>;
149
156
 
157
+ /**
158
+ * Common chart API surface used by the React wrapper.
159
+ */
160
+ declare type ChartApiInstance<HorzScaleItem = Time> = Pick<IChartApiBase<HorzScaleItem>, "applyOptions" | "remove" | "subscribeClick" | "unsubscribeClick" | "subscribeCrosshairMove" | "unsubscribeCrosshairMove" | "subscribeDblClick" | "unsubscribeDblClick">;
161
+
150
162
  /**
151
163
  * Chart API reference type that can be used to access the chart plugin API.
152
164
  */
153
- export declare type ChartApiRef = {
165
+ export declare type ChartApiRef<HorzScaleItem = Time, TChartApi extends ChartApiInstance<HorzScaleItem> = ChartApiInstance<HorzScaleItem>> = {
154
166
  /**
155
167
  * Internal reference to the chart API instance.
156
168
  */
157
- _chart: IChartApi | null;
169
+ _chart: TChartApi | null;
158
170
  /**
159
171
  * Function to get the chart API instance.
160
172
  */
161
- api: () => IChartApi | null;
173
+ api: () => TChartApi | null;
162
174
  /**
163
175
  * Function to initialize the chart API instance.
164
176
  */
165
- init: () => IChartApi | null;
177
+ init: () => TChartApi | null;
166
178
  /**
167
179
  * Function to clear the chart API instance.
168
180
  */
@@ -172,35 +184,37 @@ export declare type ChartApiRef = {
172
184
  /**
173
185
  * Chart component props.
174
186
  */
175
- export declare type ChartProps = {
176
- /**
177
- * Children of the chart component.
178
- */
179
- children?: ReactNode;
180
- /**
181
- * The props for the container element on which the chart will be rendered.
182
- */
183
- containerProps?: JSX.IntrinsicElements["div"];
184
- /**
185
- * Callback function that is called when the chart is clicked.
186
- */
187
- onClick?: MouseEventHandler<Time>;
188
- /**
189
- * Callback function that is called when the crosshair moves.
190
- */
191
- onCrosshairMove?: MouseEventHandler<Time>;
192
- /**
193
- * Callback function that is called when the chart is initialized.
194
- */
195
- onInit?: (chart: IChartApi) => void;
196
- /**
197
- * Options for the chart.
198
- */
199
- options?: DeepPartial<ChartOptions>;
187
+ export declare type ChartProps = GenericChartProps<Time, IChartApi, ChartOptions>;
188
+
189
+ /**
190
+ * CustomChart component that can be used to create a chart with a custom horizontal scale behavior.
191
+ *
192
+ * @param props - The properties for the custom chart.
193
+ * @param ref - The ref to access the chart container.
194
+ * @returns A React component that renders the custom chart.
195
+ * @see {@link https://ukorvl.github.io/lightweight-charts-react-components/docs/chart | Chart documentation}
196
+ * @see {@link https://tradingview.github.io/lightweight-charts/docs/chart-types#custom-horizontal-scale-chart | TradingView documentation for custom horizontal scale charts}
197
+ * @example
198
+ * ```tsx
199
+ * <CustomChart horzScaleBehavior={new (defaultHorzScaleBehavior())()}>
200
+ * <LineSeries data={[{ time: "2025-01-01", value: 100 }]} />
201
+ * </CustomChart>
202
+ * ```
203
+ */
204
+ export declare const CustomChart: CustomChartForwardRefComponent;
205
+
206
+ declare type CustomChartForwardRefComponent = (<HorzScaleItem, THorzScaleBehavior extends IHorzScaleBehavior<HorzScaleItem>>(props: CustomChartProps<HorzScaleItem, THorzScaleBehavior> & RefAttributes<HTMLDivElement>) => JSX.Element) & {
207
+ displayName: string;
208
+ };
209
+
210
+ /**
211
+ * CustomChart component props.
212
+ */
213
+ export declare type CustomChartProps<HorzScaleItem = Time, THorzScaleBehavior extends IHorzScaleBehavior<HorzScaleItem> = IHorzScaleBehavior<HorzScaleItem>> = GenericChartProps<HorzScaleItem, IChartApiBase<HorzScaleItem>, ReturnType<THorzScaleBehavior["options"]>> & {
200
214
  /**
201
- * Callback function that is called when the chart is double-clicked.
215
+ * Horizontal scale behavior instance passed to `createChartEx`.
202
216
  */
203
- onDblClick?: MouseEventHandler<Time>;
217
+ horzScaleBehavior: THorzScaleBehavior;
204
218
  };
205
219
 
206
220
  /**
@@ -228,19 +242,71 @@ export declare const CustomSeries: SeriesForwardRefComponent<"Custom">;
228
242
  /**
229
243
  * Unique properties for the custom series component.
230
244
  */
231
- declare type CustomSeriesUniqueProps = {
245
+ declare type CustomSeriesUniqueProps<HorzScaleItem = Time> = {
232
246
  /**
233
247
  * Custom pane view plugin instance that can be used to render custom series.
234
248
  */
235
- plugin?: ICustomSeriesPaneView;
249
+ plugin?: ICustomSeriesPaneView<HorzScaleItem>;
236
250
  };
237
251
 
238
- declare type GenericSeriesPrimitiveComponent = (<T extends SeriesType>(props: SeriesPrimitiveProps<T> & {
239
- ref?: ForwardedRef<SeriesPrimitiveApiRef>;
252
+ /**
253
+ * Generic chart component props.
254
+ */
255
+ export declare type GenericChartProps<HorzScaleItem = Time, TChartApi extends ChartApiInstance<HorzScaleItem> = ChartApiInstance<HorzScaleItem>, TOptions extends ChartOptionsImpl<HorzScaleItem> = ChartOptionsImpl<HorzScaleItem>> = {
256
+ /**
257
+ * Children of the chart component.
258
+ */
259
+ children?: ReactNode;
260
+ /**
261
+ * The props for the container element on which the chart will be rendered.
262
+ */
263
+ containerProps?: JSX.IntrinsicElements["div"];
264
+ /**
265
+ * Callback function that is called when the chart is clicked.
266
+ */
267
+ onClick?: MouseEventHandler<HorzScaleItem>;
268
+ /**
269
+ * Callback function that is called when the crosshair moves.
270
+ */
271
+ onCrosshairMove?: MouseEventHandler<HorzScaleItem>;
272
+ /**
273
+ * Callback function that is called when the chart is initialized.
274
+ */
275
+ onInit?: (chart: TChartApi) => void;
276
+ /**
277
+ * Options for the chart.
278
+ */
279
+ options?: DeepPartial<TOptions>;
280
+ /**
281
+ * Callback function that is called when the chart is double-clicked.
282
+ */
283
+ onDblClick?: MouseEventHandler<HorzScaleItem>;
284
+ };
285
+
286
+ declare type GenericMarkersComponent = (<HorzScaleItem = Time>(props: MarkersProps<HorzScaleItem> & {
287
+ ref?: ForwardedRef<MarkersApiRef<HorzScaleItem>>;
288
+ }) => JSX.Element | null) & {
289
+ displayName: string;
290
+ };
291
+
292
+ declare type GenericPaneComponent = (<HorzScaleItem = Time>(props: PaneProps & {
293
+ ref?: ForwardedRef<PaneApiRef<HorzScaleItem>>;
294
+ }) => JSX.Element) & {
295
+ displayName: string;
296
+ };
297
+
298
+ declare type GenericSeriesPrimitiveComponent = (<T extends SeriesType, HorzScaleItem = Time>(props: SeriesPrimitiveProps<T, HorzScaleItem> & {
299
+ ref?: ForwardedRef<SeriesPrimitiveApiRef<HorzScaleItem>>;
240
300
  }) => ReturnType<typeof SeriesPrimitiveRenderFunction>) & {
241
301
  displayName: string;
242
302
  };
243
303
 
304
+ declare type GenericTimeScaleComponent = (<HorzScaleItem = Time>(props: TimeScaleProps<HorzScaleItem> & {
305
+ ref?: ForwardedRef<TimeScaleApiRef<HorzScaleItem>>;
306
+ }) => JSX.Element) & {
307
+ displayName: string;
308
+ };
309
+
244
310
  /**
245
311
  * HistogramSeries component that can be used to create a histogram series in a chart.
246
312
  *
@@ -272,11 +338,11 @@ export declare type ImageWatermarkProps = {
272
338
  /**
273
339
  * Pane context that provides access to the pane API and readiness state.
274
340
  */
275
- export declare interface IPaneContext {
341
+ export declare interface IPaneContext<HorzScaleItem = Time> {
276
342
  /**
277
343
  * Reference to the pane API.
278
344
  */
279
- paneApiRef?: PaneApiRef;
345
+ paneApiRef?: PaneApiRef<HorzScaleItem>;
280
346
  /**
281
347
  * Readiness state of the pane component.
282
348
  */
@@ -322,24 +388,24 @@ export declare const LineSeries: SeriesForwardRefComponent<"Line">;
322
388
  * />
323
389
  * ```
324
390
  */
325
- export declare const Markers: ForwardRefExoticComponent<MarkersProps & RefAttributes<MarkersApiRef>>;
391
+ export declare const Markers: GenericMarkersComponent;
326
392
 
327
393
  /**
328
394
  * Markers API reference type that can be used to access the series markers plugin API.
329
395
  */
330
- export declare type MarkersApiRef = {
396
+ export declare type MarkersApiRef<HorzScaleItem = Time> = {
331
397
  /**
332
398
  * Internal reference to the series markers API instance.
333
399
  */
334
- _markers: ISeriesMarkersPluginApi<Time> | null;
400
+ _markers: ISeriesMarkersPluginApi<HorzScaleItem> | null;
335
401
  /**
336
402
  * Function to get the series markers API instance.
337
403
  */
338
- api: () => ISeriesMarkersPluginApi<Time> | null;
404
+ api: () => ISeriesMarkersPluginApi<HorzScaleItem> | null;
339
405
  /**
340
406
  * Function to initialize the series markers API instance.
341
407
  */
342
- init: () => ISeriesMarkersPluginApi<Time> | null;
408
+ init: () => ISeriesMarkersPluginApi<HorzScaleItem> | null;
343
409
  /**
344
410
  * Function to clear the series markers API instance.
345
411
  */
@@ -349,11 +415,11 @@ export declare type MarkersApiRef = {
349
415
  /**
350
416
  * Markers component properties that can be used to create a series markers component.
351
417
  */
352
- export declare type MarkersProps = {
418
+ export declare type MarkersProps<HorzScaleItem = Time> = {
353
419
  /**
354
420
  * List of markers to be displayed on the series.
355
421
  */
356
- markers: SeriesMarker<Time>[];
422
+ markers: SeriesMarker<HorzScaleItem>[];
357
423
  /**
358
424
  * Options for the markers.
359
425
  */
@@ -364,6 +430,28 @@ export declare type MarkersProps = {
364
430
  reactive?: boolean;
365
431
  };
366
432
 
433
+ /**
434
+ * OptionsChart component that can be used to create a price-based horizontal scale chart.
435
+ *
436
+ * @param props - The properties for the options chart.
437
+ * @param ref - The ref to access the chart container.
438
+ * @returns A React component that renders the options chart.
439
+ * @see {@link https://ukorvl.github.io/lightweight-charts-react-components/docs/chart | Chart documentation}
440
+ * @see {@link https://tradingview.github.io/lightweight-charts/docs/chart-types#options-chart-price-based | TradingView documentation for options charts}
441
+ * @example
442
+ * ```tsx
443
+ * <OptionsChart>
444
+ * <LineSeries data={[{ time: 95, value: 1.2 }, { time: 100, value: 2.8 }]} />
445
+ * </OptionsChart>
446
+ * ```
447
+ */
448
+ export declare const OptionsChart: ForwardRefExoticComponent<OptionsChartProps & RefAttributes<HTMLDivElement>>;
449
+
450
+ /**
451
+ * OptionsChart component props.
452
+ */
453
+ export declare type OptionsChartProps = GenericChartProps<number, IChartApiBase<number>, PriceChartOptions>;
454
+
367
455
  /**
368
456
  * Pane component that can be used to create a pane in a chart.
369
457
  *
@@ -379,24 +467,24 @@ export declare type MarkersProps = {
379
467
  * </Pane>
380
468
  * ```
381
469
  */
382
- export declare const Pane: ForwardRefExoticComponent<PaneProps & RefAttributes<PaneApiRef>>;
470
+ export declare const Pane: GenericPaneComponent;
383
471
 
384
472
  /**
385
473
  * Pane API reference type that can be used to access the pane plugin API.
386
474
  */
387
- export declare type PaneApiRef = {
475
+ export declare type PaneApiRef<HorzScaleItem = Time> = {
388
476
  /**
389
477
  * Reference to the pane API.
390
478
  */
391
- _pane: IPaneApi<Time> | null;
479
+ _pane: IPaneApi<HorzScaleItem> | null;
392
480
  /**
393
481
  * Function to get the pane API.
394
482
  */
395
- api: () => IPaneApi<Time> | null;
483
+ api: () => IPaneApi<HorzScaleItem> | null;
396
484
  /**
397
485
  * Function to initialize the pane API.
398
486
  */
399
- init: () => IPaneApi<Time> | null;
487
+ init: () => IPaneApi<HorzScaleItem> | null;
400
488
  /**
401
489
  * Function to clear the pane API.
402
490
  */
@@ -528,27 +616,27 @@ export declare type PriceScaleProps = {
528
616
  /**
529
617
  * Render function type for series primitives.
530
618
  */
531
- export declare type RenderPrimitive<T extends SeriesType = SeriesType> = ({ chart, series, }: {
532
- chart: IChartApi;
533
- series: ISeriesApi<T>;
534
- }) => ISeriesPrimitive;
619
+ export declare type RenderPrimitive<T extends SeriesType = SeriesType, HorzScaleItem = Time> = ({ chart, series, }: {
620
+ chart: IChartApiBase<HorzScaleItem>;
621
+ series: ISeriesApi<T, HorzScaleItem>;
622
+ }) => ISeriesPrimitive<HorzScaleItem>;
535
623
 
536
624
  /**
537
625
  * Series API reference type that can be used to access the series plugin API.
538
626
  */
539
- export declare type SeriesApiRef<T extends SeriesType> = {
627
+ export declare type SeriesApiRef<T extends SeriesType, HorzScaleItem = Time> = {
540
628
  /**
541
629
  * Internal reference to the series API instance.
542
630
  */
543
- _series: ISeriesApi<T> | null;
631
+ _series: ISeriesApi<T, HorzScaleItem> | null;
544
632
  /**
545
633
  * Function to get the series API instance.
546
634
  */
547
- api: () => ISeriesApi<T> | null;
635
+ api: () => ISeriesApi<T, HorzScaleItem> | null;
548
636
  /**
549
637
  * Function to initialize the series API instance.
550
638
  */
551
- init: () => ISeriesApi<T> | null;
639
+ init: () => ISeriesApi<T, HorzScaleItem> | null;
552
640
  /**
553
641
  * Function to clear the series API instance.
554
642
  */
@@ -558,15 +646,17 @@ export declare type SeriesApiRef<T extends SeriesType> = {
558
646
  /**
559
647
  * Forward ref component type for a series component.
560
648
  */
561
- declare type SeriesForwardRefComponent<T extends SeriesType> = ForwardRefExoticComponent<SeriesProps<T> & RefAttributes<SeriesApiRef<T>>>;
649
+ declare type SeriesForwardRefComponent<T extends SeriesType> = (<HorzScaleItem = Time>(props: SeriesProps<T, HorzScaleItem> & RefAttributes<SeriesApiRef<T, HorzScaleItem>>) => ReactElement | null) & {
650
+ displayName?: string;
651
+ };
562
652
 
563
653
  /**
564
654
  * Series options that can be used to customize the appearance and behavior of a series.
565
655
  */
566
656
  export declare type SeriesOptions<T extends SeriesType> = SeriesPartialOptionsMap[T];
567
657
 
568
- declare type SeriesParameters<T extends SeriesType> = {
569
- data: SeriesDataItemTypeMap[T][];
658
+ declare type SeriesParameters<T extends SeriesType, HorzScaleItem = Time> = {
659
+ data: SeriesDataItemTypeMap<HorzScaleItem>[T][];
570
660
  reactive?: boolean;
571
661
  options?: SeriesOptions<T>;
572
662
  seriesOrder?: ReturnType<ISeriesApi<T>["seriesOrder"]>;
@@ -577,7 +667,7 @@ declare type SeriesParameters<T extends SeriesType> = {
577
667
  * @see {@link https://tradingview.github.io/lightweight-charts/docs#updating-the-data-in-a-series | TradingView documentation for updating series data}
578
668
  */
579
669
  alwaysReplaceData?: boolean;
580
- } & (T extends "Custom" ? CustomSeriesUniqueProps : {});
670
+ } & (T extends "Custom" ? CustomSeriesUniqueProps<HorzScaleItem> : {});
581
671
 
582
672
  /**
583
673
  * SeriesPrimitive component that can be used to create a primitive on series.
@@ -598,19 +688,19 @@ export declare const SeriesPrimitive: GenericSeriesPrimitiveComponent;
598
688
  /**
599
689
  * Series primitive API reference type that can be used to access the series primitive plugin API.
600
690
  */
601
- export declare type SeriesPrimitiveApiRef = {
691
+ export declare type SeriesPrimitiveApiRef<HorzScaleItem = Time> = {
602
692
  /**
603
693
  * Internal reference to the series primitive API instance.
604
694
  */
605
- _primitive: ISeriesPrimitive | null;
695
+ _primitive: ISeriesPrimitive<HorzScaleItem> | null;
606
696
  /**
607
697
  * Function to get the series primitive API instance.
608
698
  */
609
- api(): ISeriesPrimitive | null;
699
+ api(): ISeriesPrimitive<HorzScaleItem> | null;
610
700
  /**
611
701
  * Function to initialize the series primitive API instance.
612
702
  */
613
- init(): ISeriesPrimitive | null;
703
+ init(): ISeriesPrimitive<HorzScaleItem> | null;
614
704
  /**
615
705
  * Function to clear the series primitive API instance.
616
706
  */
@@ -620,32 +710,32 @@ export declare type SeriesPrimitiveApiRef = {
620
710
  /**
621
711
  * Series primitive properties that can be used to create a series primitive.
622
712
  */
623
- export declare type SeriesPrimitiveProps<T extends SeriesType = SeriesType> = SeriesPrimitivePropsWithRender<T> | SeriesPrimitivePropsWithPlugin;
713
+ export declare type SeriesPrimitiveProps<T extends SeriesType = SeriesType, HorzScaleItem = Time> = SeriesPrimitivePropsWithRender<T, HorzScaleItem> | SeriesPrimitivePropsWithPlugin<HorzScaleItem>;
624
714
 
625
- declare type SeriesPrimitivePropsWithPlugin = {
626
- plugin: ISeriesPrimitive;
715
+ declare type SeriesPrimitivePropsWithPlugin<HorzScaleItem = Time> = {
716
+ plugin: ISeriesPrimitive<HorzScaleItem>;
627
717
  render?: never;
628
718
  };
629
719
 
630
- declare type SeriesPrimitivePropsWithRender<T extends SeriesType> = {
631
- render: RenderPrimitive<T>;
720
+ declare type SeriesPrimitivePropsWithRender<T extends SeriesType, HorzScaleItem = Time> = {
721
+ render: RenderPrimitive<T, HorzScaleItem>;
632
722
  plugin?: never;
633
723
  };
634
724
 
635
- declare const SeriesPrimitiveRenderFunction: <T extends SeriesType>(props: SeriesPrimitiveProps<T>, ref: ForwardedRef<SeriesPrimitiveApiRef>) => JSX.Element | null;
725
+ declare const SeriesPrimitiveRenderFunction: <T extends SeriesType, HorzScaleItem = Time>(props: SeriesPrimitiveProps<T, HorzScaleItem>, ref: ForwardedRef<SeriesPrimitiveApiRef<HorzScaleItem>>) => JSX.Element | null;
636
726
 
637
727
  /**
638
728
  * Series component properties that can be used to create a series of a specific type.
639
729
  */
640
- export declare type SeriesProps<T extends SeriesType> = Omit<SeriesTemplateProps<T>, "type">;
730
+ export declare type SeriesProps<T extends SeriesType, HorzScaleItem = Time> = Omit<SeriesTemplateProps<T, HorzScaleItem>, "type">;
641
731
 
642
732
  /**
643
733
  * Properties of a series template component that can be used to create a series of a specific type.
644
734
  */
645
- declare type SeriesTemplateProps<T extends SeriesType> = {
735
+ declare type SeriesTemplateProps<T extends SeriesType, HorzScaleItem = Time> = {
646
736
  type: T;
647
737
  children?: ReactNode;
648
- } & SeriesParameters<T>;
738
+ } & SeriesParameters<T, HorzScaleItem>;
649
739
 
650
740
  /**
651
741
  * Unique properties for the text watermark component.
@@ -662,27 +752,30 @@ export declare type TextWatermarkProps = DeepPartial<TextWatermarkOptions>;
662
752
  * @see {@link https://tradingview.github.io/lightweight-charts/docs/time-scale | TradingView documentation for time scale}
663
753
  * @example
664
754
  * ```tsx
665
- * <TimeScale visibleRange={{ from: 0, to: 100 }} onVisibleRangeChanged={() => {}} />
755
+ * <TimeScale
756
+ * visibleRange={{ from: 0, to: 100 }}
757
+ * onVisibleTimeRangeChange={() => {}}
758
+ * />
666
759
  * ```
667
760
  */
668
- export declare const TimeScale: ForwardRefExoticComponent<TimeScaleProps & RefAttributes<TimeScaleApiRef>>;
761
+ export declare const TimeScale: GenericTimeScaleComponent;
669
762
 
670
763
  /**
671
764
  * Time scale API reference type that can be used to access the time scale plugin API.
672
765
  */
673
- export declare type TimeScaleApiRef = {
766
+ export declare type TimeScaleApiRef<HorzScaleItem = Time> = {
674
767
  /**
675
768
  * Reference to the time scale API.
676
769
  */
677
- _timeScale: ITimeScaleApi<Time> | null;
770
+ _timeScale: ITimeScaleApi<HorzScaleItem> | null;
678
771
  /**
679
772
  * Function to get the time scale API.
680
773
  */
681
- api: () => ITimeScaleApi<Time> | null;
774
+ api: () => ITimeScaleApi<HorzScaleItem> | null;
682
775
  /**
683
776
  * Function to initialize the time scale API.
684
777
  */
685
- init: () => ITimeScaleApi<Time> | null;
778
+ init: () => ITimeScaleApi<HorzScaleItem> | null;
686
779
  /**
687
780
  * Function to clear the time scale API.
688
781
  */
@@ -720,11 +813,11 @@ declare type TimeScaleOptions = DeepPartial<TimeScaleOptions_2>;
720
813
  * Use this component to configure how the chart's visible time/logical range is initialized
721
814
  * and updated, and to react to time scale updates via event handlers.
722
815
  */
723
- export declare type TimeScaleProps = {
816
+ export declare type TimeScaleProps<HorzScaleItem = Time> = {
724
817
  /**
725
818
  * Callback for when the visible time range changes.
726
819
  */
727
- onVisibleTimeRangeChange?: TimeRangeChangeEventHandler<Time>;
820
+ onVisibleTimeRangeChange?: TimeRangeChangeEventHandler<HorzScaleItem>;
728
821
  /**
729
822
  * Callback for when the visible logical range changes.
730
823
  */
@@ -736,7 +829,7 @@ export declare type TimeScaleProps = {
736
829
  /**
737
830
  * The visible time range for the time scale.
738
831
  */
739
- visibleRange?: IRange<Time>;
832
+ visibleRange?: IRange<HorzScaleItem>;
740
833
  /**
741
834
  * The visible logical range for the time scale.
742
835
  */
@@ -754,7 +847,17 @@ export declare type TimeScaleProps = {
754
847
  /**
755
848
  * Watermark API reference type that can be used to access the watermark plugin API.
756
849
  */
757
- export declare type WatermarkApiRef<T extends WatermarkType> = T extends "text" ? WatermarkTextApiRefBase : WatermarkImageApiRefBase;
850
+ export declare type WatermarkApiRef<T extends WatermarkType, HorzScaleItem = Time> = T extends "text" ? {
851
+ _watermark: ITextWatermarkPluginApi<HorzScaleItem> | null;
852
+ api: () => ITextWatermarkPluginApi<HorzScaleItem> | null;
853
+ init: () => ITextWatermarkPluginApi<HorzScaleItem> | null;
854
+ clear: () => void;
855
+ } : {
856
+ _watermark: IImageWatermarkPluginApi<HorzScaleItem> | null;
857
+ api: () => IImageWatermarkPluginApi<HorzScaleItem> | null;
858
+ init: () => IImageWatermarkPluginApi<HorzScaleItem> | null;
859
+ clear: () => void;
860
+ };
758
861
 
759
862
  /**
760
863
  * Watermark component that can be used to add an image watermark to a chart pane.
@@ -775,13 +878,6 @@ export declare type WatermarkApiRef<T extends WatermarkType> = T extends "text"
775
878
  */
776
879
  export declare const WatermarkImage: ForwardRefExoticComponent<ImageWatermarkProps & RefAttributes<WatermarkApiRef<"image">>>;
777
880
 
778
- declare type WatermarkImageApiRefBase = {
779
- _watermark: IImageWatermarkPluginApi<Time> | null;
780
- api: () => IImageWatermarkPluginApi<Time> | null;
781
- init: () => IImageWatermarkPluginApi<Time> | null;
782
- clear: () => void;
783
- };
784
-
785
881
  /**
786
882
  * Watermark component that can be used to add a text or image watermark to a chart pane.
787
883
  *
@@ -803,13 +899,6 @@ declare type WatermarkImageApiRefBase = {
803
899
  */
804
900
  export declare const WatermarkText: ForwardRefExoticComponent<TextWatermarkProps & RefAttributes<WatermarkApiRef<"text">>>;
805
901
 
806
- declare type WatermarkTextApiRefBase = {
807
- _watermark: ITextWatermarkPluginApi<Time> | null;
808
- api: () => ITextWatermarkPluginApi<Time> | null;
809
- init: () => ITextWatermarkPluginApi<Time> | null;
810
- clear: () => void;
811
- };
812
-
813
902
  /**
814
903
  * Watermark types supported by the library.
815
904
  * - `text`: A text watermark.
@@ -817,4 +906,26 @@ declare type WatermarkTextApiRefBase = {
817
906
  */
818
907
  export declare type WatermarkType = "text" | "image";
819
908
 
909
+ /**
910
+ * YieldCurveChart component that can be used to create a yield curve chart.
911
+ *
912
+ * @param props - The properties for the yield curve chart.
913
+ * @param ref - The ref to access the chart container.
914
+ * @returns A React component that renders the yield curve chart.
915
+ * @see {@link https://ukorvl.github.io/lightweight-charts-react-components/docs/chart | Chart documentation}
916
+ * @see {@link https://tradingview.github.io/lightweight-charts/docs/chart-types#yield-curve-chart | TradingView documentation for yield curve charts}
917
+ * @example
918
+ * ```tsx
919
+ * <YieldCurveChart>
920
+ * <LineSeries data={[{ time: 1, value: 5.2 }, { time: 12, value: 4.7 }]} />
921
+ * </YieldCurveChart>
922
+ * ```
923
+ */
924
+ export declare const YieldCurveChart: ForwardRefExoticComponent<YieldCurveChartProps & RefAttributes<HTMLDivElement>>;
925
+
926
+ /**
927
+ * YieldCurveChart component props.
928
+ */
929
+ export declare type YieldCurveChartProps = GenericChartProps<number, IYieldCurveChartApi, YieldCurveChartOptions>;
930
+
820
931
  export { }