Skip to content

Commit

Permalink
LG-4783: Clean up charts exported types (#2639)
Browse files Browse the repository at this point in the history
* Fix prop exports

* Changeset

* Lint

* Add specific export change

* Fix update
  • Loading branch information
tsck authored Jan 21, 2025
1 parent a1cb248 commit c2bca68
Show file tree
Hide file tree
Showing 11 changed files with 40 additions and 18 deletions.
7 changes: 7 additions & 0 deletions .changeset/friendly-tips-complain.md
Original file line number Diff line number Diff line change
@@ -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`
2 changes: 1 addition & 1 deletion charts/core/src/Chart/Chart.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 &
Expand Down
9 changes: 5 additions & 4 deletions charts/core/src/Chart/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export { Chart } from './Chart';
export {
type ChartOptions,
type ChartProps,
type SeriesOption,
export type {
ChartOptions,
ChartProps,
SeriesOption,
ZoomSelectionEvent,
} from './Chart.types';
2 changes: 1 addition & 1 deletion charts/core/src/ChartCard/index.tsx
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { ChartCard } from './ChartCard';
export { ChartCardProps } from './ChartCard.types';
export type { ChartCardProps } from './ChartCard.types';
1 change: 1 addition & 0 deletions charts/core/src/Grid/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export { Grid } from './Grid';
export type { GridProps } from './Grid.types';
1 change: 1 addition & 0 deletions charts/core/src/Header/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export { Header } from './Header';
export type { HeaderProps } from './Header.types';
2 changes: 1 addition & 1 deletion charts/core/src/Line/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { Line } from './Line';
export { type LineProps } from './Line.types';
export type { LineProps } from './Line.types';
6 changes: 6 additions & 0 deletions charts/core/src/Tooltip/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
export { Tooltip } from './Tooltip';
export {
SortDirection,
SortKey,
SortOrder,
type TooltipProps,
} from './Tooltip.types';
2 changes: 1 addition & 1 deletion charts/core/src/XAxis/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { XAxis } from './XAxis';
export { XAxisProps } from './XAxis.types';
export type { XAxisProps, XAxisType } from './XAxis.types';
2 changes: 1 addition & 1 deletion charts/core/src/YAxis/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { YAxis } from './YAxis';
export { YAxisProps } from './YAxis.types';
export type { YAxisProps, YAxisType } from './YAxis.types';
24 changes: 15 additions & 9 deletions charts/core/src/index.ts
Original file line number Diff line number Diff line change
@@ -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';

0 comments on commit c2bca68

Please sign in to comment.