From ce7fe853515ebd31111ad88e90da5552edf9130f Mon Sep 17 00:00:00 2001 From: plouc Date: Sat, 29 Apr 2023 05:57:08 +0900 Subject: [PATCH] feat(core): directly export types --- packages/core/index.d.ts | 1080 ++++++++++++++++++------------------ packages/core/package.json | 1 + 2 files changed, 540 insertions(+), 541 deletions(-) diff --git a/packages/core/index.d.ts b/packages/core/index.d.ts index bcc055ac5..ee689ca08 100644 --- a/packages/core/index.d.ts +++ b/packages/core/index.d.ts @@ -3,594 +3,592 @@ import { Interpolation, SpringConfig } from '@react-spring/web' import { CurveFactory } from 'd3-shape' import { ComponentType } from 'react' -declare module '@nivo/core' { - export type DatumValue = string | number | Date +export type DatumValue = string | number | Date - export interface Dimensions { - height: number - width: number - } +export interface Dimensions { + height: number + width: number +} - export interface Point { - x: number - y: number - } +export interface Point { + x: number + y: number +} - export interface AlignBox extends Dimensions, Point {} +export interface AlignBox extends Dimensions, Point {} - export type Margin = { - bottom: number - left: number - right: number - top: number - } +export type Margin = { + bottom: number + left: number + right: number + top: number +} - export type Box = Partial - export type BoxAlign = - | 'center' - | 'top-left' - | 'top' - | 'top-right' - | 'right' - | 'bottom-right' - | 'bottom' - | 'bottom-left' - | 'left' - export const boxAlignments: BoxAlign[] - export function alignBox( - box: AlignBox, - container: AlignBox, - alignment: BoxAlign - ): [number, number] - - export type GetColor = (datum: T) => string - export type Colors = string[] | string - export interface ColorProps { - colors?: Colors - colorBy?: string | GetColor - } +export type Box = Partial +export type BoxAlign = + | 'center' + | 'top-left' + | 'top' + | 'top-right' + | 'right' + | 'bottom-right' + | 'bottom' + | 'bottom-left' + | 'left' +export const boxAlignments: BoxAlign[] +export function alignBox( + box: AlignBox, + container: AlignBox, + alignment: BoxAlign +): [number, number] + +export type GetColor = (datum: T) => string +export type Colors = string[] | string +export interface ColorProps { + colors?: Colors + colorBy?: string | GetColor +} - export type CompleteTheme = { - crosshair: { - line: { - stroke: string - strokeWidth: number - strokeOpacity: number - strokeDasharray: string - } +export type CompleteTheme = { + crosshair: { + line: { + stroke: string + strokeWidth: number + strokeOpacity: number + strokeDasharray: string } - background: string - fontFamily: string - fontSize: number - textColor: string - axis: { - domain: { - line: Partial - } - ticks: { - line: Partial - text: Partial - } - legend: { - text: Partial - } - } - grid: { + } + background: string + fontFamily: string + fontSize: number + textColor: string + axis: { + domain: { line: Partial } - legends: { - hidden: { - symbol: Partial<{ - fill: string - opacity: number - }> - text: Partial - } - title: { - text: Partial - } + ticks: { + line: Partial text: Partial - ticks: { - line: Partial - text: Partial - } } - labels: { + legend: { text: Partial } - markers: { - lineColor: string - lineStrokeWidth: number - textColor: string - fontSize: string | 0 + } + grid: { + line: Partial + } + legends: { + hidden: { + symbol: Partial<{ + fill: string + opacity: number + }> text: Partial } - dots: { + title: { text: Partial } - tooltip: { - container: Partial - basic: Partial - chip: Partial - table: Partial - tableCell: Partial - tableCellValue: Partial - } - annotations: { - text: { - fill: string - outlineWidth: number - outlineColor: string - outlineOpacity: number - } & Partial> - link: { - stroke: string - strokeWidth: number - outlineWidth: number - outlineColor: string - outlineOpacity: number - } & Partial> - outline: { - stroke: string - strokeWidth: number - outlineWidth: number - outlineColor: string - outlineOpacity: number - } & Partial> - symbol: { - fill: string - outlineWidth: number - outlineColor: string - outlineOpacity: number - } & Partial> + text: Partial + ticks: { + line: Partial + text: Partial } } + labels: { + text: Partial + } + markers: { + lineColor: string + lineStrokeWidth: number + textColor: string + fontSize: string | 0 + text: Partial + } + dots: { + text: Partial + } + tooltip: { + container: Partial + basic: Partial + chip: Partial + table: Partial + tableCell: Partial + tableCellValue: Partial + } + annotations: { + text: { + fill: string + outlineWidth: number + outlineColor: string + outlineOpacity: number + } & Partial> + link: { + stroke: string + strokeWidth: number + outlineWidth: number + outlineColor: string + outlineOpacity: number + } & Partial> + outline: { + stroke: string + strokeWidth: number + outlineWidth: number + outlineColor: string + outlineOpacity: number + } & Partial> + symbol: { + fill: string + outlineWidth: number + outlineColor: string + outlineOpacity: number + } & Partial> + } +} - export type Theme = Partial< - Pick & { - crosshair: Partial<{ - line: Partial - }> - axis: Partial<{ - domain: Partial<{ - line: Partial - }> - ticks: Partial<{ - line: Partial - text: Partial - }> - legend: Partial<{ - text: Partial - }> +export type Theme = Partial< + Pick & { + crosshair: Partial<{ + line: Partial + }> + axis: Partial<{ + domain: Partial<{ + line: Partial }> - grid: Partial<{ - line: Partial + ticks: Partial<{ + line: Partial + text: Partial }> - legends: Partial<{ - hidden: Partial<{ - symbol: CompleteTheme['legends']['hidden']['symbol'] - text: CompleteTheme['legends']['hidden']['text'] - }> - title: Partial<{ - text: Partial - }> - text: Partial - ticks: Partial<{ - line: Partial - text: Partial - }> + legend: Partial<{ + text: Partial }> - labels: Partial<{ - text: Partial + }> + grid: Partial<{ + line: Partial + }> + legends: Partial<{ + hidden: Partial<{ + symbol: CompleteTheme['legends']['hidden']['symbol'] + text: CompleteTheme['legends']['hidden']['text'] }> - markers: Partial - dots: Partial<{ - text: Partial + title: Partial<{ + text: Partial }> - tooltip: Partial - annotations: Partial<{ - text: Partial - link: Partial - outline: Partial - symbol: Partial + text: Partial + ticks: Partial<{ + line: Partial + text: Partial }> - } - > - - export function useTheme(): CompleteTheme - export function usePartialTheme(theme?: Theme): CompleteTheme - - export type MotionProps = Partial<{ - animate: boolean - motionDamping: number - motionStiffness: number - }> - - export type ModernMotionProps = Partial<{ - animate: boolean - motionConfig: string | SpringConfig - }> - - export function useMotionConfig(): { - animate: boolean - config: SpringConfig - springConfig: { - stiffness: number - damping: number - } + }> + labels: Partial<{ + text: Partial + }> + markers: Partial + dots: Partial<{ + text: Partial + }> + tooltip: Partial + annotations: Partial<{ + text: Partial + link: Partial + outline: Partial + symbol: Partial + }> } - - export type SvgFillMatcher = (datum: T) => boolean - export interface SvgDefsAndFill { - defs?: { - id: string - [key: string]: any - }[] - fill?: { id: string; match: Record | SvgFillMatcher | '*' }[] +> + +export function useTheme(): CompleteTheme +export function usePartialTheme(theme?: Theme): CompleteTheme + +export type MotionProps = Partial<{ + animate: boolean + motionDamping: number + motionStiffness: number +}> + +export type ModernMotionProps = Partial<{ + animate: boolean + motionConfig: string | SpringConfig +}> + +export function useMotionConfig(): { + animate: boolean + config: SpringConfig + springConfig: { + stiffness: number + damping: number } +} + +export type SvgFillMatcher = (datum: T) => boolean +export interface SvgDefsAndFill { + defs?: { + id: string + [key: string]: any + }[] + fill?: { id: string; match: Record | SvgFillMatcher | '*' }[] +} + +export type CssMixBlendMode = + | 'normal' + | 'multiply' + | 'screen' + | 'overlay' + | 'darken' + | 'lighten' + | 'color-dodge' + | 'color-burn' + | 'hard-light' + | 'soft-light' + | 'difference' + | 'exclusion' + | 'hue' + | 'saturation' + | 'color' + | 'luminosity' + +export type StackOrder = 'ascending' | 'descending' | 'insideOut' | 'none' | 'reverse' + +export type StackOffset = 'expand' | 'diverging' | 'none' | 'silhouette' | 'wiggle' + +export type AreaCurve = + | 'basis' + | 'cardinal' + | 'catmullRom' + | 'linear' + | 'monotoneX' + | 'monotoneY' + | 'natural' + | 'step' + | 'stepAfter' + | 'stepBefore' + +export function useAnimatedPath(path: string): Interpolation + +// ------------------------------------------------------------------------ +// Patterns & Gradients +// ------------------------------------------------------------------------ + +export type GradientColor = { + offset: number + color: string + opacity?: number +} - export type CssMixBlendMode = - | 'normal' - | 'multiply' - | 'screen' - | 'overlay' - | 'darken' - | 'lighten' - | 'color-dodge' - | 'color-burn' - | 'hard-light' - | 'soft-light' - | 'difference' - | 'exclusion' - | 'hue' - | 'saturation' - | 'color' - | 'luminosity' - - export type StackOrder = 'ascending' | 'descending' | 'insideOut' | 'none' | 'reverse' - - export type StackOffset = 'expand' | 'diverging' | 'none' | 'silhouette' | 'wiggle' - - export type AreaCurve = - | 'basis' - | 'cardinal' - | 'catmullRom' - | 'linear' - | 'monotoneX' - | 'monotoneY' - | 'natural' - | 'step' - | 'stepAfter' - | 'stepBefore' - - export function useAnimatedPath(path: string): Interpolation - - // ------------------------------------------------------------------------ - // Patterns & Gradients - // ------------------------------------------------------------------------ - - export type GradientColor = { +export function linearGradientDef( + id: string, + colors: GradientColor[], + options?: React.SVGProps +): { + id: string + type: 'linearGradient' + colors: GradientColor[] +} & React.SVGProps + +export type LinearGradientDef = { + id: string + type: 'linearGradient' + colors: { offset: number color: string opacity?: number - } + }[] + gradientTransform?: string +} - export function linearGradientDef( - id: string, - colors: GradientColor[], - options?: React.SVGProps - ): { - id: string - type: 'linearGradient' - colors: GradientColor[] - } & React.SVGProps +export type PatternDotsDef = { + id: string + type: 'patternDots' + color?: string + background?: string + size?: number + padding?: number + stagger?: boolean +} +export function patternDotsDef( + id: string, + options?: Omit +): PatternDotsDef +export function PatternDots(props: Omit): JSX.Element + +export type PatternSquaresDef = Omit & { + type: 'patternSquares' +} +export function patternSquaresDef( + id: string, + options?: Omit +): PatternSquaresDef +export function PatternSquares(props: Omit): JSX.Element + +export type PatternLinesDef = { + id: string + type: 'patternLines' + spacing?: number + rotation?: number + background?: string + color?: string + lineWidth?: number +} +export function patternLinesDef( + id: string, + options?: Omit +): PatternLinesDef +export function PatternLines(props: Omit): JSX.Element - export type LinearGradientDef = { - id: string - type: 'linearGradient' - colors: { - offset: number - color: string - opacity?: number - }[] - gradientTransform?: string - } +export type Def = LinearGradientDef | PatternDotsDef | PatternSquaresDef | PatternLinesDef - export type PatternDotsDef = { - id: string - type: 'patternDots' - color?: string - background?: string - size?: number - padding?: number - stagger?: boolean - } - export function patternDotsDef( - id: string, - options?: Omit - ): PatternDotsDef - export function PatternDots(props: Omit): JSX.Element - - export type PatternSquaresDef = Omit & { - type: 'patternSquares' - } - export function patternSquaresDef( - id: string, - options?: Omit - ): PatternSquaresDef - export function PatternSquares(props: Omit): JSX.Element - - export type PatternLinesDef = { - id: string - type: 'patternLines' - spacing?: number - rotation?: number - background?: string - color?: string - lineWidth?: number - } - export function patternLinesDef( - id: string, - options?: Omit - ): PatternLinesDef - export function PatternLines(props: Omit): JSX.Element +export type DefsProps = { + defs: Def[] +} - export type Def = LinearGradientDef | PatternDotsDef | PatternSquaresDef | PatternLinesDef +export function Defs(props: DefsProps): JSX.Element - export type DefsProps = { - defs: Def[] - } +// ------------------------------------------------------------------------ +// Motion +// ------------------------------------------------------------------------ - export function Defs(props: DefsProps): JSX.Element +export const defaultAnimate = true +export const defaultMotionStiffness = 90 +export const defaultMotionDamping = 15 - // ------------------------------------------------------------------------ - // Motion - // ------------------------------------------------------------------------ +type MotionDefaultProps = { + animate: true + stiffness: 90 + damping: 15 + config: 'default' +} +export const motionDefaultProps: MotionDefaultProps - export const defaultAnimate = true - export const defaultMotionStiffness = 90 - export const defaultMotionDamping = 15 +type DefaultMargin = { + top: 0 + right: 0 + bottom: 0 + left: 0 +} +export const defaultMargin: DefaultMargin + +export function degreesToRadians(degrees: number): number +export function radiansToDegrees(radians: number): number +export function absoluteAngleDegrees(degrees: number): number +export function normalizeAngle(degrees: number): number +export function clampArc( + startAngle: number, + endAngle: number, + length?: number +): [number, number] + +type Accessor = T extends string ? U[T] : never + +export type DatumPropertyAccessor = (datum: RawDatum) => T + +export function useDimensions( + width: number, + height: number, + margin?: Box +): { + margin: Margin + innerWidth: number + innerHeight: number + outerWidth: number + outerHeight: number +} - type MotionDefaultProps = { - animate: true - stiffness: 90 - damping: 15 - config: 'default' - } - export const motionDefaultProps: MotionDefaultProps +export function useMeasure(): [ + React.RefObject, + { left: number; top: number; width: number; height: number } +] - type DefaultMargin = { - top: 0 - right: 0 - bottom: 0 - left: 0 - } - export const defaultMargin: DefaultMargin - - export function degreesToRadians(degrees: number): number - export function radiansToDegrees(radians: number): number - export function absoluteAngleDegrees(degrees: number): number - export function normalizeAngle(degrees: number): number - export function clampArc( - startAngle: number, - endAngle: number, - length?: number - ): [number, number] - - type Accessor = T extends string ? U[T] : never - - export type DatumPropertyAccessor = (datum: RawDatum) => T - - export function useDimensions( - width: number, - height: number, - margin?: Box - ): { +type SvgWrapperType = ( + props: React.PropsWithChildren<{ + width: number + height: number margin: Margin - innerWidth: number - innerHeight: number - outerWidth: number - outerHeight: number - } - - export function useMeasure(): [ - React.RefObject, - { left: number; top: number; width: number; height: number } - ] - - type SvgWrapperType = ( - props: React.PropsWithChildren<{ - width: number - height: number - margin: Margin - defs?: any - role?: string - ariaLabel?: React.AriaAttributes['aria-label'] - ariaLabelledBy?: React.AriaAttributes['aria-labelledby'] - ariaDescribedBy?: React.AriaAttributes['aria-describedby'] - isFocusable?: boolean - }> - ) => JSX.Element - export const SvgWrapper: SvgWrapperType - - interface ContainerProps { - theme?: Theme - renderWrapper?: boolean - isInteractive?: boolean - animate?: boolean - motionStiffness?: number - motionDamping?: number - motionConfig?: string | SpringConfig - } - type ContainerType = (props: React.PropsWithChildren) => JSX.Element - export const Container: ContainerType - - type ResponsiveWrapperType = (props: { - children: (dimensions: { width: number; height: number }) => JSX.Element - }) => JSX.Element - export const ResponsiveWrapper: ResponsiveWrapperType + defs?: any + role?: string + ariaLabel?: React.AriaAttributes['aria-label'] + ariaLabelledBy?: React.AriaAttributes['aria-labelledby'] + ariaDescribedBy?: React.AriaAttributes['aria-describedby'] + isFocusable?: boolean + }> +) => JSX.Element +export const SvgWrapper: SvgWrapperType + +interface ContainerProps { + theme?: Theme + renderWrapper?: boolean + isInteractive?: boolean + animate?: boolean + motionStiffness?: number + motionDamping?: number + motionConfig?: string | SpringConfig +} +type ContainerType = (props: React.PropsWithChildren) => JSX.Element +export const Container: ContainerType - interface ThemeProviderProps { - theme?: Theme - } +type ResponsiveWrapperType = (props: { + children: (dimensions: { width: number; height: number }) => JSX.Element +}) => JSX.Element +export const ResponsiveWrapper: ResponsiveWrapperType - type ThemeProviderType = (props: React.PropsWithChildren) => JSX.Element - export const ThemeProvider: ThemeProviderType +interface ThemeProviderProps { + theme?: Theme +} - export function getDistance(x1: number, y1: number, x2: number, y2: number): number - export function getAngle(x1: number, y1: number, x2: number, y2: number): number +type ThemeProviderType = (props: React.PropsWithChildren) => JSX.Element +export const ThemeProvider: ThemeProviderType - export function positionFromAngle( - angle: number, - distance: number - ): { - x: number - y: number - } +export function getDistance(x1: number, y1: number, x2: number, y2: number): number +export function getAngle(x1: number, y1: number, x2: number, y2: number): number - export type ValueFormat = - | string // d3 formatter - // explicit formatting function - | (Context extends void - ? (value: Value) => string - : (value: Value, context: Context) => string) - export function getValueFormatter( - format?: ValueFormat - ): Context extends void ? (value: Value) => string : (value: Value, context: Context) => string - export function useValueFormatter( - format?: ValueFormat - ): Context extends void ? (value: Value) => string : (value: Value, context: Context) => string - - export type PropertyAccessor = - // path to use with `lodash.get()` - | string - // explicit accessor function - | ((datum: Datum) => Value) - export function getPropertyAccessor( - accessor: PropertyAccessor - ): (datum: Datum) => Value - export function usePropertyAccessor( - accessor: PropertyAccessor - ): (datum: Datum) => Value - - export function getRelativeCursor(element: Element, event: React.MouseEvent): [number, number] - export function isCursorInRect( - x: number, - y: number, - width: number, - height: number, - cursorX: number, - cursorY: number - ): boolean - - export interface CartesianMarkerProps { - axis: 'x' | 'y' - value: V - legend?: string - legendOrientation?: 'horizontal' | 'vertical' - legendPosition?: BoxAlign - lineStyle?: Partial - textStyle?: Partial - } - interface CartesianMarkersProps< - X extends DatumValue = DatumValue, - Y extends DatumValue = DatumValue - > { - width: number - height: number - xScale: (value: X) => number - yScale: (value: Y) => number - markers: CartesianMarkerProps[] - } - type CartesianMarkersType = < - X extends DatumValue = DatumValue, - Y extends DatumValue = DatumValue - >( - props: CartesianMarkersProps - ) => JSX.Element - export const CartesianMarkers: CartesianMarkersType - - export type CurveFactoryId = - | 'basis' - | 'basisClosed' - | 'basisOpen' - | 'bundle' - | 'cardinal' - | 'cardinalClosed' - | 'cardinalOpen' - | 'catmullRom' - | 'catmullRomClosed' - | 'catmullRomOpen' - | 'linear' - | 'linearClosed' - | 'monotoneX' - | 'monotoneY' - | 'natural' - | 'step' - | 'stepAfter' - | 'stepBefore' - - // Curve factories compatible d3 line shape generator - export type LineCurveFactoryId = - | 'basis' - | 'cardinal' - | 'catmullRom' - | 'linear' - | 'monotoneX' - | 'monotoneY' - | 'natural' - | 'step' - | 'stepAfter' - | 'stepBefore' - - // Curve factories compatible d3 area shape generator - export type AreaCurveFactoryId = - | 'basis' - | 'cardinal' - | 'catmullRom' - | 'linear' - | 'monotoneX' - | 'monotoneY' - | 'natural' - | 'step' - | 'stepAfter' - | 'stepBefore' - - export type ClosedCurveFactoryId = - | 'basisClosed' - | 'cardinalClosed' - | 'catmullRomClosed' - | 'linearClosed' - export const closedCurvePropKeys: ClosedCurveFactoryId[] - - export const curveFromProp: (interpolation: CurveFactoryId) => CurveFactory - - export const useCurveInterpolation: (interpolation: CurveFactoryId) => CurveFactory - - export interface DotsItemSymbolProps { - size: number - color: string - borderWidth: number - borderColor: string - } - export type DotsItemSymbolComponent = React.FunctionComponent - - export interface DotsItemProps { - datum: D - x: number - y: number - size: number - color: string - borderWidth: number - borderColor: string - label?: string | number - labelTextAnchor?: 'start' | 'middle' | 'end' - labelYOffset?: number - symbol?: DotsItemSymbolComponent - } - export const DotsItem: React.FunctionComponent +export function positionFromAngle( + angle: number, + distance: number +): { + x: number + y: number +} - export type ExtractProps = TComponent extends ComponentType - ? TProps - : never +export type ValueFormat = + | string // d3 formatter + // explicit formatting function + | (Context extends void + ? (value: Value) => string + : (value: Value, context: Context) => string) +export function getValueFormatter( + format?: ValueFormat +): Context extends void ? (value: Value) => string : (value: Value, context: Context) => string +export function useValueFormatter( + format?: ValueFormat +): Context extends void ? (value: Value) => string : (value: Value, context: Context) => string + +export type PropertyAccessor = + // path to use with `lodash.get()` + | string + // explicit accessor function + | ((datum: Datum) => Value) +export function getPropertyAccessor( + accessor: PropertyAccessor +): (datum: Datum) => Value +export function usePropertyAccessor( + accessor: PropertyAccessor +): (datum: Datum) => Value + +export function getRelativeCursor(element: Element, event: React.MouseEvent): [number, number] +export function isCursorInRect( + x: number, + y: number, + width: number, + height: number, + cursorX: number, + cursorY: number +): boolean + +export interface CartesianMarkerProps { + axis: 'x' | 'y' + value: V + legend?: string + legendOrientation?: 'horizontal' | 'vertical' + legendPosition?: BoxAlign + lineStyle?: Partial + textStyle?: Partial +} +interface CartesianMarkersProps< + X extends DatumValue = DatumValue, + Y extends DatumValue = DatumValue +> { + width: number + height: number + xScale: (value: X) => number + yScale: (value: Y) => number + markers: CartesianMarkerProps[] } +type CartesianMarkersType = < + X extends DatumValue = DatumValue, + Y extends DatumValue = DatumValue +>( + props: CartesianMarkersProps +) => JSX.Element +export const CartesianMarkers: CartesianMarkersType + +export type CurveFactoryId = + | 'basis' + | 'basisClosed' + | 'basisOpen' + | 'bundle' + | 'cardinal' + | 'cardinalClosed' + | 'cardinalOpen' + | 'catmullRom' + | 'catmullRomClosed' + | 'catmullRomOpen' + | 'linear' + | 'linearClosed' + | 'monotoneX' + | 'monotoneY' + | 'natural' + | 'step' + | 'stepAfter' + | 'stepBefore' + +// Curve factories compatible d3 line shape generator +export type LineCurveFactoryId = + | 'basis' + | 'cardinal' + | 'catmullRom' + | 'linear' + | 'monotoneX' + | 'monotoneY' + | 'natural' + | 'step' + | 'stepAfter' + | 'stepBefore' + +// Curve factories compatible d3 area shape generator +export type AreaCurveFactoryId = + | 'basis' + | 'cardinal' + | 'catmullRom' + | 'linear' + | 'monotoneX' + | 'monotoneY' + | 'natural' + | 'step' + | 'stepAfter' + | 'stepBefore' + +export type ClosedCurveFactoryId = + | 'basisClosed' + | 'cardinalClosed' + | 'catmullRomClosed' + | 'linearClosed' +export const closedCurvePropKeys: ClosedCurveFactoryId[] + +export const curveFromProp: (interpolation: CurveFactoryId) => CurveFactory + +export const useCurveInterpolation: (interpolation: CurveFactoryId) => CurveFactory + +export interface DotsItemSymbolProps { + size: number + color: string + borderWidth: number + borderColor: string +} +export type DotsItemSymbolComponent = React.FunctionComponent + +export interface DotsItemProps { + datum: D + x: number + y: number + size: number + color: string + borderWidth: number + borderColor: string + label?: string | number + labelTextAnchor?: 'start' | 'middle' | 'end' + labelYOffset?: number + symbol?: DotsItemSymbolComponent +} +export const DotsItem: React.FunctionComponent + +export type ExtractProps = TComponent extends ComponentType + ? TProps + : never diff --git a/packages/core/package.json b/packages/core/package.json index 5f57c82be..4e13d9060 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -13,6 +13,7 @@ }, "main": "./dist/nivo-core.cjs.js", "module": "./dist/nivo-core.es.js", + "types": "./index.d.ts", "files": [ "README.md", "LICENSE.md",