From c2bca684ae58c923ed7fb6b495774b9cf7f9a1ff Mon Sep 17 00:00:00 2001 From: Terrence Keane Date: Tue, 21 Jan 2025 10:18:17 -0500 Subject: [PATCH] LG-4783: Clean up charts exported types (#2639) * Fix prop exports * Changeset * Lint * Add specific export change * Fix update --- .changeset/friendly-tips-complain.md | 7 +++++++ charts/core/src/Chart/Chart.types.ts | 2 +- charts/core/src/Chart/index.ts | 9 +++++---- charts/core/src/ChartCard/index.tsx | 2 +- charts/core/src/Grid/index.ts | 1 + charts/core/src/Header/index.ts | 1 + charts/core/src/Line/index.ts | 2 +- charts/core/src/Tooltip/index.ts | 6 ++++++ charts/core/src/XAxis/index.ts | 2 +- charts/core/src/YAxis/index.ts | 2 +- charts/core/src/index.ts | 24 +++++++++++++++--------- 11 files changed, 40 insertions(+), 18 deletions(-) create mode 100644 .changeset/friendly-tips-complain.md diff --git a/.changeset/friendly-tips-complain.md b/.changeset/friendly-tips-complain.md new file mode 100644 index 0000000000..853ca9e114 --- /dev/null +++ b/.changeset/friendly-tips-complain.md @@ -0,0 +1,7 @@ +--- +'@lg-charts/core': minor +--- + +Cleans up exported types +- Adds: `ChartCardProps`, `GridProps`, `HeaderProps`, `LineProps`, `ThresholdLineProps`, `SortDirection`, `SortKey`, `SortOrder`, `TooltipProps`, `XAxisType`, `YAxisType` +- Removes: `ChartOptions`, `SeriesOption` diff --git a/charts/core/src/Chart/Chart.types.ts b/charts/core/src/Chart/Chart.types.ts index 314e3fea36..e95869decc 100644 --- a/charts/core/src/Chart/Chart.types.ts +++ b/charts/core/src/Chart/Chart.types.ts @@ -12,7 +12,7 @@ import { ZoomSelect } from './hooks/useChart.types'; export type SeriesOption = EChartSeriesOption; export type ChartOptions = EChartOptions; -type ZoomSelectionEvent = EChartZoomSelectionEvent; +export type ZoomSelectionEvent = EChartZoomSelectionEvent; export type ChartProps = HTMLElementProps<'div'> & DarkModeProps & diff --git a/charts/core/src/Chart/index.ts b/charts/core/src/Chart/index.ts index d83079353d..3267c7ed51 100644 --- a/charts/core/src/Chart/index.ts +++ b/charts/core/src/Chart/index.ts @@ -1,6 +1,7 @@ export { Chart } from './Chart'; -export { - type ChartOptions, - type ChartProps, - type SeriesOption, +export type { + ChartOptions, + ChartProps, + SeriesOption, + ZoomSelectionEvent, } from './Chart.types'; diff --git a/charts/core/src/ChartCard/index.tsx b/charts/core/src/ChartCard/index.tsx index 2a637f1a7d..4ac2c4c729 100644 --- a/charts/core/src/ChartCard/index.tsx +++ b/charts/core/src/ChartCard/index.tsx @@ -1,2 +1,2 @@ export { ChartCard } from './ChartCard'; -export { ChartCardProps } from './ChartCard.types'; +export type { ChartCardProps } from './ChartCard.types'; diff --git a/charts/core/src/Grid/index.ts b/charts/core/src/Grid/index.ts index 66c39561da..4a1ba78880 100644 --- a/charts/core/src/Grid/index.ts +++ b/charts/core/src/Grid/index.ts @@ -1 +1,2 @@ export { Grid } from './Grid'; +export type { GridProps } from './Grid.types'; diff --git a/charts/core/src/Header/index.ts b/charts/core/src/Header/index.ts index 29429dc97e..5c7d7607f4 100644 --- a/charts/core/src/Header/index.ts +++ b/charts/core/src/Header/index.ts @@ -1 +1,2 @@ export { Header } from './Header'; +export type { HeaderProps } from './Header.types'; diff --git a/charts/core/src/Line/index.ts b/charts/core/src/Line/index.ts index 08d6636e4b..89ce84c147 100644 --- a/charts/core/src/Line/index.ts +++ b/charts/core/src/Line/index.ts @@ -1,2 +1,2 @@ export { Line } from './Line'; -export { type LineProps } from './Line.types'; +export type { LineProps } from './Line.types'; diff --git a/charts/core/src/Tooltip/index.ts b/charts/core/src/Tooltip/index.ts index b44d466fac..eda14ad043 100644 --- a/charts/core/src/Tooltip/index.ts +++ b/charts/core/src/Tooltip/index.ts @@ -1 +1,7 @@ export { Tooltip } from './Tooltip'; +export { + SortDirection, + SortKey, + SortOrder, + type TooltipProps, +} from './Tooltip.types'; diff --git a/charts/core/src/XAxis/index.ts b/charts/core/src/XAxis/index.ts index e2eb00a351..f390ec4b1b 100644 --- a/charts/core/src/XAxis/index.ts +++ b/charts/core/src/XAxis/index.ts @@ -1,2 +1,2 @@ export { XAxis } from './XAxis'; -export { XAxisProps } from './XAxis.types'; +export type { XAxisProps, XAxisType } from './XAxis.types'; diff --git a/charts/core/src/YAxis/index.ts b/charts/core/src/YAxis/index.ts index ee94057486..7440ba97d9 100644 --- a/charts/core/src/YAxis/index.ts +++ b/charts/core/src/YAxis/index.ts @@ -1,2 +1,2 @@ export { YAxis } from './YAxis'; -export { YAxisProps } from './YAxis.types'; +export type { YAxisProps, YAxisType } from './YAxis.types'; diff --git a/charts/core/src/index.ts b/charts/core/src/index.ts index 230c4249a6..d66a508159 100644 --- a/charts/core/src/index.ts +++ b/charts/core/src/index.ts @@ -1,15 +1,21 @@ -export { Chart, type ChartOptions, type SeriesOption } from './Chart'; -export { ChartCard } from './ChartCard'; +export { Chart } from './Chart'; +export { ChartCard, type ChartCardProps } from './ChartCard'; export { EventMarkerLine, type EventMarkerLineProps, EventMarkerPoint, type EventMarkerPointProps, } from './EventMarkers'; -export { Grid } from './Grid'; -export { Header } from './Header'; -export { Line } from './Line'; -export { ThresholdLine } from './ThresholdLine'; -export { Tooltip } from './Tooltip'; -export { XAxis, type XAxisProps } from './XAxis'; -export { YAxis, type YAxisProps } from './YAxis'; +export { Grid, type GridProps } from './Grid'; +export { Header, type HeaderProps } from './Header'; +export { Line, type LineProps } from './Line'; +export { ThresholdLine, type ThresholdLineProps } from './ThresholdLine'; +export { + SortDirection, + SortKey, + SortOrder, + Tooltip, + type TooltipProps, +} from './Tooltip'; +export { XAxis, type XAxisProps, type XAxisType } from './XAxis'; +export { YAxis, type YAxisProps, type YAxisType } from './YAxis';