diff --git a/packages/bar/index.d.ts b/packages/bar/index.d.ts index d828caa86..8bcf4dd1c 100644 --- a/packages/bar/index.d.ts +++ b/packages/bar/index.d.ts @@ -39,7 +39,6 @@ declare module '@nivo/bar' { value: number index: number indexValue: Value - color: string data: BarDatum } @@ -51,19 +50,18 @@ declare module '@nivo/bar' { export type ValueFormatter = (value: number) => string | number - export type BarMouseEventHandler = ( + type GraphicsContainer = HTMLCanvasElement | SVGRectElement + + export type BarMouseEventHandler = ( datum: BarExtendedDatum, event: React.MouseEvent ) => void - export type TooltipProp = React.StatelessComponent + export type BarTooltipDatum = BarExtendedDatum & { color: string } + export type TooltipProp = React.FC export interface BarItemProps { - data: { - id: string | number - value: number - indexValue: string | number - } + data: BarExtendedDatum x: number y: number width: number @@ -80,7 +78,7 @@ declare module '@nivo/bar' { onMouseLeave: BarMouseEventHandler tooltipFormat: string | ValueFormatter tooltip: TooltipProp - showTooltip: (tooltip: React.ReactNode, event: React.MouseEvent) => void + showTooltip: (tooltip: React.ReactNode, event: React.MouseEvent) => void hideTooltip: () => void theme: Theme } @@ -109,7 +107,7 @@ declare module '@nivo/bar' { enableGridY: boolean gridYValues: GridValues - barComponent: React.StatelessComponent + barComponent: React.FC enableLabel: boolean label: string | AccessorFunc diff --git a/packages/swarmplot/index.d.ts b/packages/swarmplot/index.d.ts index c5eae65a8..7eeb91870 100644 --- a/packages/swarmplot/index.d.ts +++ b/packages/swarmplot/index.d.ts @@ -47,7 +47,7 @@ declare module '@nivo/swarmplot' { Axes = 'axes', Nodes = 'nodes', Mesh = 'mesh', - Annotations = 'annotations' + Annotations = 'annotations', } type DatumAccessor = (datum: Datum) => T