liveline 0.0.4 → 0.0.5

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
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { CSSProperties } from 'react';
2
+ import { CSSProperties, ReactElement } from 'react';
3
3
 
4
4
  interface LivelinePoint {
5
5
  time: number;
@@ -73,10 +73,49 @@ interface LivelineProps {
73
73
  onHover?: (point: HoverPoint | null) => void;
74
74
  cursor?: string;
75
75
  pulse?: boolean;
76
+ mode?: 'line' | 'candle';
77
+ candles?: CandlePoint[];
78
+ candleWidth?: number;
79
+ liveCandle?: CandlePoint;
80
+ lineMode?: boolean;
81
+ lineData?: LivelinePoint[];
82
+ lineValue?: number;
83
+ onModeChange?: (mode: 'line' | 'candle') => void;
76
84
  className?: string;
77
85
  style?: CSSProperties;
78
86
  }
87
+ interface CandlePoint {
88
+ time: number;
89
+ open: number;
90
+ high: number;
91
+ low: number;
92
+ close: number;
93
+ }
94
+
95
+ declare function Liveline({ data, value, theme, color, window: windowSecs, grid, badge, momentum, fill, scrub, loading, paused, emptyText, exaggerate, degen: degenProp, badgeTail, badgeVariant, showValue, valueMomentumColor, windows, onWindowChange, windowStyle, tooltipY, tooltipOutline, orderbook, referenceLine, formatValue, formatTime, lerpSpeed, padding: paddingOverride, onHover, cursor, pulse, mode, candles, candleWidth, liveCandle, lineMode, lineData, lineValue, onModeChange, className, style, }: LivelineProps): react_jsx_runtime.JSX.Element;
79
96
 
80
- declare function Liveline({ data, value, theme, color, window: windowSecs, grid, badge, momentum, fill, scrub, loading, paused, emptyText, exaggerate, degen: degenProp, badgeTail, badgeVariant, showValue, valueMomentumColor, windows, onWindowChange, windowStyle, tooltipY, tooltipOutline, orderbook, referenceLine, formatValue, formatTime, lerpSpeed, padding: paddingOverride, onHover, cursor, pulse, className, style, }: LivelineProps): react_jsx_runtime.JSX.Element;
97
+ interface LivelineTransitionProps {
98
+ /** Key of the active child to display. Must match a child's `key` prop. */
99
+ active: string;
100
+ /** Chart elements with unique `key` props */
101
+ children: ReactElement | ReactElement[];
102
+ /** Cross-fade duration in ms (default 300) */
103
+ duration?: number;
104
+ className?: string;
105
+ style?: CSSProperties;
106
+ }
107
+ /**
108
+ * Cross-fade between chart components (e.g. line ↔ candlestick).
109
+ * Children must have unique `key` props matching possible `active` values.
110
+ *
111
+ * @example
112
+ * ```tsx
113
+ * <LivelineTransition active={chartType}>
114
+ * <Liveline key="line" data={data} value={value} />
115
+ * <Liveline key="candle" mode="candle" candles={candles} candleWidth={5} data={data} value={value} />
116
+ * </LivelineTransition>
117
+ * ```
118
+ */
119
+ declare function LivelineTransition({ active, children, duration, className, style, }: LivelineTransitionProps): react_jsx_runtime.JSX.Element;
81
120
 
82
- export { type BadgeVariant, type DegenOptions, type HoverPoint, Liveline, type LivelinePoint, type LivelineProps, type Momentum, type OrderbookData, type Padding, type ReferenceLine, type ThemeMode, type WindowOption, type WindowStyle };
121
+ export { type BadgeVariant, type CandlePoint, type DegenOptions, type HoverPoint, Liveline, type LivelinePoint, type LivelineProps, LivelineTransition, type LivelineTransitionProps, type Momentum, type OrderbookData, type Padding, type ReferenceLine, type ThemeMode, type WindowOption, type WindowStyle };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { CSSProperties } from 'react';
2
+ import { CSSProperties, ReactElement } from 'react';
3
3
 
4
4
  interface LivelinePoint {
5
5
  time: number;
@@ -73,10 +73,49 @@ interface LivelineProps {
73
73
  onHover?: (point: HoverPoint | null) => void;
74
74
  cursor?: string;
75
75
  pulse?: boolean;
76
+ mode?: 'line' | 'candle';
77
+ candles?: CandlePoint[];
78
+ candleWidth?: number;
79
+ liveCandle?: CandlePoint;
80
+ lineMode?: boolean;
81
+ lineData?: LivelinePoint[];
82
+ lineValue?: number;
83
+ onModeChange?: (mode: 'line' | 'candle') => void;
76
84
  className?: string;
77
85
  style?: CSSProperties;
78
86
  }
87
+ interface CandlePoint {
88
+ time: number;
89
+ open: number;
90
+ high: number;
91
+ low: number;
92
+ close: number;
93
+ }
94
+
95
+ declare function Liveline({ data, value, theme, color, window: windowSecs, grid, badge, momentum, fill, scrub, loading, paused, emptyText, exaggerate, degen: degenProp, badgeTail, badgeVariant, showValue, valueMomentumColor, windows, onWindowChange, windowStyle, tooltipY, tooltipOutline, orderbook, referenceLine, formatValue, formatTime, lerpSpeed, padding: paddingOverride, onHover, cursor, pulse, mode, candles, candleWidth, liveCandle, lineMode, lineData, lineValue, onModeChange, className, style, }: LivelineProps): react_jsx_runtime.JSX.Element;
79
96
 
80
- declare function Liveline({ data, value, theme, color, window: windowSecs, grid, badge, momentum, fill, scrub, loading, paused, emptyText, exaggerate, degen: degenProp, badgeTail, badgeVariant, showValue, valueMomentumColor, windows, onWindowChange, windowStyle, tooltipY, tooltipOutline, orderbook, referenceLine, formatValue, formatTime, lerpSpeed, padding: paddingOverride, onHover, cursor, pulse, className, style, }: LivelineProps): react_jsx_runtime.JSX.Element;
97
+ interface LivelineTransitionProps {
98
+ /** Key of the active child to display. Must match a child's `key` prop. */
99
+ active: string;
100
+ /** Chart elements with unique `key` props */
101
+ children: ReactElement | ReactElement[];
102
+ /** Cross-fade duration in ms (default 300) */
103
+ duration?: number;
104
+ className?: string;
105
+ style?: CSSProperties;
106
+ }
107
+ /**
108
+ * Cross-fade between chart components (e.g. line ↔ candlestick).
109
+ * Children must have unique `key` props matching possible `active` values.
110
+ *
111
+ * @example
112
+ * ```tsx
113
+ * <LivelineTransition active={chartType}>
114
+ * <Liveline key="line" data={data} value={value} />
115
+ * <Liveline key="candle" mode="candle" candles={candles} candleWidth={5} data={data} value={value} />
116
+ * </LivelineTransition>
117
+ * ```
118
+ */
119
+ declare function LivelineTransition({ active, children, duration, className, style, }: LivelineTransitionProps): react_jsx_runtime.JSX.Element;
81
120
 
82
- export { type BadgeVariant, type DegenOptions, type HoverPoint, Liveline, type LivelinePoint, type LivelineProps, type Momentum, type OrderbookData, type Padding, type ReferenceLine, type ThemeMode, type WindowOption, type WindowStyle };
121
+ export { type BadgeVariant, type CandlePoint, type DegenOptions, type HoverPoint, Liveline, type LivelinePoint, type LivelineProps, LivelineTransition, type LivelineTransitionProps, type Momentum, type OrderbookData, type Padding, type ReferenceLine, type ThemeMode, type WindowOption, type WindowStyle };