lightweight-charts-react-components 1.4.0 → 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.0
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,15 +29,19 @@ 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';
37
43
  import type { SeriesMarker } from 'lightweight-charts';
44
+ import type { SeriesMarkersOptions } from 'lightweight-charts';
38
45
  import type { SeriesPartialOptionsMap } from 'lightweight-charts';
39
46
  import type { SeriesType } from 'lightweight-charts';
40
47
  import type { SizeChangeEventHandler } from 'lightweight-charts';
@@ -42,6 +49,7 @@ import type { TextWatermarkOptions } from 'lightweight-charts';
42
49
  import { Time } from 'lightweight-charts';
43
50
  import type { TimeRangeChangeEventHandler } from 'lightweight-charts';
44
51
  import type { TimeScaleOptions as TimeScaleOptions_2 } from 'lightweight-charts';
52
+ import { YieldCurveChartOptions } from 'lightweight-charts';
45
53
 
46
54
  /**
47
55
  * AreaSeries component that can be used to create an area series in a chart.
@@ -62,7 +70,7 @@ import type { TimeScaleOptions as TimeScaleOptions_2 } from 'lightweight-charts'
62
70
  * />
63
71
  * ```
64
72
  */
65
- export declare const AreaSeries: ForwardRefExoticComponent<SeriesProps<"Area"> & RefAttributes<SeriesApiRef<"Area">>>;
73
+ export declare const AreaSeries: SeriesForwardRefComponent<"Area">;
66
74
 
67
75
  /**
68
76
  * BarSeries component that can be used to create a bar series in a chart.
@@ -83,7 +91,7 @@ export declare const AreaSeries: ForwardRefExoticComponent<SeriesProps<"Area"> &
83
91
  * />
84
92
  * ```
85
93
  */
86
- export declare const BarSeries: ForwardRefExoticComponent<SeriesProps<"Bar"> & RefAttributes<SeriesApiRef<"Bar">>>;
94
+ export declare const BarSeries: SeriesForwardRefComponent<"Bar">;
87
95
 
88
96
  /**
89
97
  * BaselineSeries component that can be used to create a baseline series in a chart.
@@ -104,7 +112,7 @@ export declare const BarSeries: ForwardRefExoticComponent<SeriesProps<"Bar"> & R
104
112
  * />
105
113
  * ```
106
114
  */
107
- export declare const BaselineSeries: ForwardRefExoticComponent<SeriesProps<"Baseline"> & RefAttributes<SeriesApiRef<"Baseline">>>;
115
+ export declare const BaselineSeries: SeriesForwardRefComponent<"Baseline">;
108
116
 
109
117
  /**
110
118
  * CandlestickSeries component that can be used to create a candlestick series in a chart.
@@ -125,7 +133,7 @@ export declare const BaselineSeries: ForwardRefExoticComponent<SeriesProps<"Base
125
133
  * />
126
134
  * ```
127
135
  */
128
- export declare const CandlestickSeries: ForwardRefExoticComponent<SeriesProps<"Candlestick"> & RefAttributes<SeriesApiRef<"Candlestick">>>;
136
+ export declare const CandlestickSeries: SeriesForwardRefComponent<"Candlestick">;
129
137
 
130
138
  /**
131
139
  * Chart component that can be used to create a chart.
@@ -146,22 +154,27 @@ export declare const CandlestickSeries: ForwardRefExoticComponent<SeriesProps<"C
146
154
  */
147
155
  export declare const Chart: ForwardRefExoticComponent<ChartProps & RefAttributes<HTMLDivElement>>;
148
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
+
149
162
  /**
150
163
  * Chart API reference type that can be used to access the chart plugin API.
151
164
  */
152
- export declare type ChartApiRef = {
165
+ export declare type ChartApiRef<HorzScaleItem = Time, TChartApi extends ChartApiInstance<HorzScaleItem> = ChartApiInstance<HorzScaleItem>> = {
153
166
  /**
154
167
  * Internal reference to the chart API instance.
155
168
  */
156
- _chart: IChartApi | null;
169
+ _chart: TChartApi | null;
157
170
  /**
158
171
  * Function to get the chart API instance.
159
172
  */
160
- api: () => IChartApi | null;
173
+ api: () => TChartApi | null;
161
174
  /**
162
175
  * Function to initialize the chart API instance.
163
176
  */
164
- init: () => IChartApi | null;
177
+ init: () => TChartApi | null;
165
178
  /**
166
179
  * Function to clear the chart API instance.
167
180
  */
@@ -171,35 +184,37 @@ export declare type ChartApiRef = {
171
184
  /**
172
185
  * Chart component props.
173
186
  */
174
- export declare type ChartProps = {
175
- /**
176
- * Children of the chart component.
177
- */
178
- children?: ReactNode;
179
- /**
180
- * The props for the container element on which the chart will be rendered.
181
- */
182
- containerProps?: JSX.IntrinsicElements["div"];
183
- /**
184
- * Callback function that is called when the chart is clicked.
185
- */
186
- onClick?: MouseEventHandler<Time>;
187
- /**
188
- * Callback function that is called when the crosshair moves.
189
- */
190
- onCrosshairMove?: MouseEventHandler<Time>;
191
- /**
192
- * Callback function that is called when the chart is initialized.
193
- */
194
- onInit?: (chart: IChartApi) => void;
195
- /**
196
- * Options for the chart.
197
- */
198
- 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"]>> & {
199
214
  /**
200
- * Callback function that is called when the chart is double-clicked.
215
+ * Horizontal scale behavior instance passed to `createChartEx`.
201
216
  */
202
- onDblClick?: MouseEventHandler<Time>;
217
+ horzScaleBehavior: THorzScaleBehavior;
203
218
  };
204
219
 
205
220
  /**
@@ -222,24 +237,76 @@ export declare type ChartProps = {
222
237
  * />
223
238
  * ```
224
239
  */
225
- export declare const CustomSeries: ForwardRefExoticComponent<SeriesProps<"Custom"> & RefAttributes<SeriesApiRef<"Custom">>>;
240
+ export declare const CustomSeries: SeriesForwardRefComponent<"Custom">;
226
241
 
227
242
  /**
228
243
  * Unique properties for the custom series component.
229
244
  */
230
- declare type CustomSeriesUniqueProps = {
245
+ declare type CustomSeriesUniqueProps<HorzScaleItem = Time> = {
231
246
  /**
232
247
  * Custom pane view plugin instance that can be used to render custom series.
233
248
  */
234
- plugin?: ICustomSeriesPaneView;
249
+ plugin?: ICustomSeriesPaneView<HorzScaleItem>;
235
250
  };
236
251
 
237
- declare type GenericSeriesPrimitiveComponent = (<T extends SeriesType>(props: SeriesPrimitiveProps<T> & {
238
- 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>>;
239
300
  }) => ReturnType<typeof SeriesPrimitiveRenderFunction>) & {
240
301
  displayName: string;
241
302
  };
242
303
 
304
+ declare type GenericTimeScaleComponent = (<HorzScaleItem = Time>(props: TimeScaleProps<HorzScaleItem> & {
305
+ ref?: ForwardedRef<TimeScaleApiRef<HorzScaleItem>>;
306
+ }) => JSX.Element) & {
307
+ displayName: string;
308
+ };
309
+
243
310
  /**
244
311
  * HistogramSeries component that can be used to create a histogram series in a chart.
245
312
  *
@@ -259,7 +326,7 @@ declare type GenericSeriesPrimitiveComponent = (<T extends SeriesType>(props: Se
259
326
  * />
260
327
  * ```
261
328
  */
262
- export declare const HistogramSeries: ForwardRefExoticComponent<SeriesProps<"Histogram"> & RefAttributes<SeriesApiRef<"Histogram">>>;
329
+ export declare const HistogramSeries: SeriesForwardRefComponent<"Histogram">;
263
330
 
264
331
  /**
265
332
  * Unique properties for the image watermark component.
@@ -271,11 +338,11 @@ export declare type ImageWatermarkProps = {
271
338
  /**
272
339
  * Pane context that provides access to the pane API and readiness state.
273
340
  */
274
- export declare interface IPaneContext {
341
+ export declare interface IPaneContext<HorzScaleItem = Time> {
275
342
  /**
276
343
  * Reference to the pane API.
277
344
  */
278
- paneApiRef?: PaneApiRef;
345
+ paneApiRef?: PaneApiRef<HorzScaleItem>;
279
346
  /**
280
347
  * Readiness state of the pane component.
281
348
  */
@@ -301,7 +368,7 @@ export declare interface IPaneContext {
301
368
  * />
302
369
  * ```
303
370
  */
304
- export declare const LineSeries: ForwardRefExoticComponent<SeriesProps<"Line"> & RefAttributes<SeriesApiRef<"Line">>>;
371
+ export declare const LineSeries: SeriesForwardRefComponent<"Line">;
305
372
 
306
373
  /**
307
374
  * Markers component that can be used to add markers to a chart pane.
@@ -321,24 +388,24 @@ export declare const LineSeries: ForwardRefExoticComponent<SeriesProps<"Line"> &
321
388
  * />
322
389
  * ```
323
390
  */
324
- export declare const Markers: ForwardRefExoticComponent<MarkersProps & RefAttributes<MarkersApiRef>>;
391
+ export declare const Markers: GenericMarkersComponent;
325
392
 
326
393
  /**
327
394
  * Markers API reference type that can be used to access the series markers plugin API.
328
395
  */
329
- export declare type MarkersApiRef = {
396
+ export declare type MarkersApiRef<HorzScaleItem = Time> = {
330
397
  /**
331
398
  * Internal reference to the series markers API instance.
332
399
  */
333
- _markers: ISeriesMarkersPluginApi<Time> | null;
400
+ _markers: ISeriesMarkersPluginApi<HorzScaleItem> | null;
334
401
  /**
335
402
  * Function to get the series markers API instance.
336
403
  */
337
- api: () => ISeriesMarkersPluginApi<Time> | null;
404
+ api: () => ISeriesMarkersPluginApi<HorzScaleItem> | null;
338
405
  /**
339
406
  * Function to initialize the series markers API instance.
340
407
  */
341
- init: () => ISeriesMarkersPluginApi<Time> | null;
408
+ init: () => ISeriesMarkersPluginApi<HorzScaleItem> | null;
342
409
  /**
343
410
  * Function to clear the series markers API instance.
344
411
  */
@@ -348,17 +415,43 @@ export declare type MarkersApiRef = {
348
415
  /**
349
416
  * Markers component properties that can be used to create a series markers component.
350
417
  */
351
- export declare type MarkersProps = {
418
+ export declare type MarkersProps<HorzScaleItem = Time> = {
352
419
  /**
353
420
  * List of markers to be displayed on the series.
354
421
  */
355
- markers: SeriesMarker<Time>[];
422
+ markers: SeriesMarker<HorzScaleItem>[];
356
423
  /**
357
424
  * Options for the markers.
358
425
  */
426
+ options?: DeepPartial<SeriesMarkersOptions>;
427
+ /**
428
+ * Whether markers should update reactively when marker list changes.
429
+ */
359
430
  reactive?: boolean;
360
431
  };
361
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
+
362
455
  /**
363
456
  * Pane component that can be used to create a pane in a chart.
364
457
  *
@@ -374,24 +467,24 @@ export declare type MarkersProps = {
374
467
  * </Pane>
375
468
  * ```
376
469
  */
377
- export declare const Pane: ForwardRefExoticComponent<PaneProps & RefAttributes<PaneApiRef>>;
470
+ export declare const Pane: GenericPaneComponent;
378
471
 
379
472
  /**
380
473
  * Pane API reference type that can be used to access the pane plugin API.
381
474
  */
382
- export declare type PaneApiRef = {
475
+ export declare type PaneApiRef<HorzScaleItem = Time> = {
383
476
  /**
384
477
  * Reference to the pane API.
385
478
  */
386
- _pane: IPaneApi<Time> | null;
479
+ _pane: IPaneApi<HorzScaleItem> | null;
387
480
  /**
388
481
  * Function to get the pane API.
389
482
  */
390
- api: () => IPaneApi<Time> | null;
483
+ api: () => IPaneApi<HorzScaleItem> | null;
391
484
  /**
392
485
  * Function to initialize the pane API.
393
486
  */
394
- init: () => IPaneApi<Time> | null;
487
+ init: () => IPaneApi<HorzScaleItem> | null;
395
488
  /**
396
489
  * Function to clear the pane API.
397
490
  */
@@ -523,40 +616,47 @@ export declare type PriceScaleProps = {
523
616
  /**
524
617
  * Render function type for series primitives.
525
618
  */
526
- export declare type RenderPrimitive<T extends SeriesType = SeriesType> = ({ chart, series, }: {
527
- chart: IChartApi;
528
- series: ISeriesApi<T>;
529
- }) => 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>;
530
623
 
531
624
  /**
532
625
  * Series API reference type that can be used to access the series plugin API.
533
626
  */
534
- export declare type SeriesApiRef<T extends SeriesType> = {
627
+ export declare type SeriesApiRef<T extends SeriesType, HorzScaleItem = Time> = {
535
628
  /**
536
629
  * Internal reference to the series API instance.
537
630
  */
538
- _series: ISeriesApi<T> | null;
631
+ _series: ISeriesApi<T, HorzScaleItem> | null;
539
632
  /**
540
633
  * Function to get the series API instance.
541
634
  */
542
- api: () => ISeriesApi<T> | null;
635
+ api: () => ISeriesApi<T, HorzScaleItem> | null;
543
636
  /**
544
637
  * Function to initialize the series API instance.
545
638
  */
546
- init: () => ISeriesApi<T> | null;
639
+ init: () => ISeriesApi<T, HorzScaleItem> | null;
547
640
  /**
548
641
  * Function to clear the series API instance.
549
642
  */
550
643
  clear: () => void;
551
644
  };
552
645
 
646
+ /**
647
+ * Forward ref component type for a series component.
648
+ */
649
+ declare type SeriesForwardRefComponent<T extends SeriesType> = (<HorzScaleItem = Time>(props: SeriesProps<T, HorzScaleItem> & RefAttributes<SeriesApiRef<T, HorzScaleItem>>) => ReactElement | null) & {
650
+ displayName?: string;
651
+ };
652
+
553
653
  /**
554
654
  * Series options that can be used to customize the appearance and behavior of a series.
555
655
  */
556
656
  export declare type SeriesOptions<T extends SeriesType> = SeriesPartialOptionsMap[T];
557
657
 
558
- declare type SeriesParameters<T extends SeriesType> = {
559
- data: SeriesDataItemTypeMap[T][];
658
+ declare type SeriesParameters<T extends SeriesType, HorzScaleItem = Time> = {
659
+ data: SeriesDataItemTypeMap<HorzScaleItem>[T][];
560
660
  reactive?: boolean;
561
661
  options?: SeriesOptions<T>;
562
662
  seriesOrder?: ReturnType<ISeriesApi<T>["seriesOrder"]>;
@@ -567,7 +667,7 @@ declare type SeriesParameters<T extends SeriesType> = {
567
667
  * @see {@link https://tradingview.github.io/lightweight-charts/docs#updating-the-data-in-a-series | TradingView documentation for updating series data}
568
668
  */
569
669
  alwaysReplaceData?: boolean;
570
- } & (T extends "Custom" ? CustomSeriesUniqueProps : {});
670
+ } & (T extends "Custom" ? CustomSeriesUniqueProps<HorzScaleItem> : {});
571
671
 
572
672
  /**
573
673
  * SeriesPrimitive component that can be used to create a primitive on series.
@@ -588,19 +688,19 @@ export declare const SeriesPrimitive: GenericSeriesPrimitiveComponent;
588
688
  /**
589
689
  * Series primitive API reference type that can be used to access the series primitive plugin API.
590
690
  */
591
- export declare type SeriesPrimitiveApiRef = {
691
+ export declare type SeriesPrimitiveApiRef<HorzScaleItem = Time> = {
592
692
  /**
593
693
  * Internal reference to the series primitive API instance.
594
694
  */
595
- _primitive: ISeriesPrimitive | null;
695
+ _primitive: ISeriesPrimitive<HorzScaleItem> | null;
596
696
  /**
597
697
  * Function to get the series primitive API instance.
598
698
  */
599
- api(): ISeriesPrimitive | null;
699
+ api(): ISeriesPrimitive<HorzScaleItem> | null;
600
700
  /**
601
701
  * Function to initialize the series primitive API instance.
602
702
  */
603
- init(): ISeriesPrimitive | null;
703
+ init(): ISeriesPrimitive<HorzScaleItem> | null;
604
704
  /**
605
705
  * Function to clear the series primitive API instance.
606
706
  */
@@ -610,32 +710,32 @@ export declare type SeriesPrimitiveApiRef = {
610
710
  /**
611
711
  * Series primitive properties that can be used to create a series primitive.
612
712
  */
613
- 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>;
614
714
 
615
- declare type SeriesPrimitivePropsWithPlugin = {
616
- plugin: ISeriesPrimitive;
715
+ declare type SeriesPrimitivePropsWithPlugin<HorzScaleItem = Time> = {
716
+ plugin: ISeriesPrimitive<HorzScaleItem>;
617
717
  render?: never;
618
718
  };
619
719
 
620
- declare type SeriesPrimitivePropsWithRender<T extends SeriesType> = {
621
- render: RenderPrimitive<T>;
720
+ declare type SeriesPrimitivePropsWithRender<T extends SeriesType, HorzScaleItem = Time> = {
721
+ render: RenderPrimitive<T, HorzScaleItem>;
622
722
  plugin?: never;
623
723
  };
624
724
 
625
- 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;
626
726
 
627
727
  /**
628
728
  * Series component properties that can be used to create a series of a specific type.
629
729
  */
630
- 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">;
631
731
 
632
732
  /**
633
733
  * Properties of a series template component that can be used to create a series of a specific type.
634
734
  */
635
- declare type SeriesTemplateProps<T extends SeriesType> = {
735
+ declare type SeriesTemplateProps<T extends SeriesType, HorzScaleItem = Time> = {
636
736
  type: T;
637
737
  children?: ReactNode;
638
- } & SeriesParameters<T>;
738
+ } & SeriesParameters<T, HorzScaleItem>;
639
739
 
640
740
  /**
641
741
  * Unique properties for the text watermark component.
@@ -652,27 +752,30 @@ export declare type TextWatermarkProps = DeepPartial<TextWatermarkOptions>;
652
752
  * @see {@link https://tradingview.github.io/lightweight-charts/docs/time-scale | TradingView documentation for time scale}
653
753
  * @example
654
754
  * ```tsx
655
- * <TimeScale visibleRange={{ from: 0, to: 100 }} onVisibleRangeChanged={() => {}} />
755
+ * <TimeScale
756
+ * visibleRange={{ from: 0, to: 100 }}
757
+ * onVisibleTimeRangeChange={() => {}}
758
+ * />
656
759
  * ```
657
760
  */
658
- export declare const TimeScale: ForwardRefExoticComponent<TimeScaleProps & RefAttributes<TimeScaleApiRef>>;
761
+ export declare const TimeScale: GenericTimeScaleComponent;
659
762
 
660
763
  /**
661
764
  * Time scale API reference type that can be used to access the time scale plugin API.
662
765
  */
663
- export declare type TimeScaleApiRef = {
766
+ export declare type TimeScaleApiRef<HorzScaleItem = Time> = {
664
767
  /**
665
768
  * Reference to the time scale API.
666
769
  */
667
- _timeScale: ITimeScaleApi<Time> | null;
770
+ _timeScale: ITimeScaleApi<HorzScaleItem> | null;
668
771
  /**
669
772
  * Function to get the time scale API.
670
773
  */
671
- api: () => ITimeScaleApi<Time> | null;
774
+ api: () => ITimeScaleApi<HorzScaleItem> | null;
672
775
  /**
673
776
  * Function to initialize the time scale API.
674
777
  */
675
- init: () => ITimeScaleApi<Time> | null;
778
+ init: () => ITimeScaleApi<HorzScaleItem> | null;
676
779
  /**
677
780
  * Function to clear the time scale API.
678
781
  */
@@ -705,13 +808,16 @@ export declare type TimeScaleFitContentTriggerProps = {
705
808
  declare type TimeScaleOptions = DeepPartial<TimeScaleOptions_2>;
706
809
 
707
810
  /**
708
- * TimeScale component props.
811
+ * Props for the TimeScale component that controls chart time scale behavior.
812
+ *
813
+ * Use this component to configure how the chart's visible time/logical range is initialized
814
+ * and updated, and to react to time scale updates via event handlers.
709
815
  */
710
- export declare type TimeScaleProps = {
816
+ export declare type TimeScaleProps<HorzScaleItem = Time> = {
711
817
  /**
712
818
  * Callback for when the visible time range changes.
713
819
  */
714
- onVisibleTimeRangeChange?: TimeRangeChangeEventHandler<Time>;
820
+ onVisibleTimeRangeChange?: TimeRangeChangeEventHandler<HorzScaleItem>;
715
821
  /**
716
822
  * Callback for when the visible logical range changes.
717
823
  */
@@ -723,7 +829,7 @@ export declare type TimeScaleProps = {
723
829
  /**
724
830
  * The visible time range for the time scale.
725
831
  */
726
- visibleRange?: IRange<Time>;
832
+ visibleRange?: IRange<HorzScaleItem>;
727
833
  /**
728
834
  * The visible logical range for the time scale.
729
835
  */
@@ -741,7 +847,17 @@ export declare type TimeScaleProps = {
741
847
  /**
742
848
  * Watermark API reference type that can be used to access the watermark plugin API.
743
849
  */
744
- 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
+ };
745
861
 
746
862
  /**
747
863
  * Watermark component that can be used to add an image watermark to a chart pane.
@@ -762,13 +878,6 @@ export declare type WatermarkApiRef<T extends WatermarkType> = T extends "text"
762
878
  */
763
879
  export declare const WatermarkImage: ForwardRefExoticComponent<ImageWatermarkProps & RefAttributes<WatermarkApiRef<"image">>>;
764
880
 
765
- declare type WatermarkImageApiRefBase = {
766
- _watermark: IImageWatermarkPluginApi<Time> | null;
767
- api: () => IImageWatermarkPluginApi<Time> | null;
768
- init: () => IImageWatermarkPluginApi<Time> | null;
769
- clear: () => void;
770
- };
771
-
772
881
  /**
773
882
  * Watermark component that can be used to add a text or image watermark to a chart pane.
774
883
  *
@@ -790,13 +899,6 @@ declare type WatermarkImageApiRefBase = {
790
899
  */
791
900
  export declare const WatermarkText: ForwardRefExoticComponent<TextWatermarkProps & RefAttributes<WatermarkApiRef<"text">>>;
792
901
 
793
- declare type WatermarkTextApiRefBase = {
794
- _watermark: ITextWatermarkPluginApi<Time> | null;
795
- api: () => ITextWatermarkPluginApi<Time> | null;
796
- init: () => ITextWatermarkPluginApi<Time> | null;
797
- clear: () => void;
798
- };
799
-
800
902
  /**
801
903
  * Watermark types supported by the library.
802
904
  * - `text`: A text watermark.
@@ -804,4 +906,26 @@ declare type WatermarkTextApiRefBase = {
804
906
  */
805
907
  export declare type WatermarkType = "text" | "image";
806
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
+
807
931
  export { }