palerdot/react-d3-speedometer

Missing Types @types/react-d3-speedometer

Closed this issue · 6 comments

Required typescript support.
temp-solution: Create react-d3-speedometer.d.ts file in your custom_typings folder and declare it.

@StevensonNelli This is in the roadmap. I will add support for typescript and update this issue as soon as possible ...

Here are the type declarations.

declare module 'react-d3-speedometer' {
  type Props = {
    currentValuePlaceholderStyle?: string
    currentValueText?: string
    customSegmentStops?: number[]
    dimensionUnit?: string
    endColor?: string
    fluidWidth?: boolean
    forceRender?: boolean
    height?: number
    labelFontSize?: string
    maxSegmentLabels?: number
    maxValue?: number
    minValue?: number
    needleColor?: string
    needleHeightRatio?: number
    needleTransition?: string
    needleTransitionDuration?: number
    paddingHorizontal?: number
    paddingVertical?: number
    ringWidth?: number
    segmentColors?: string[]
    segments?: number
    startColor?: string
    textColor?: string
    value?: number
    valueFormat?: string
    valueTextFontSize?: string
    width?: number
  }

  const ReactSpeedometer: React.FunctionComponent<Props>
  export default ReactSpeedometer
}

@mskelton Thanks for helping out with declaration. If you are interested in raising PR, please feel free to do so. In any case, I will try to resolve this issue as early as possible.

@palerdot Unfortunately, I'm no longer using this project in any of my active projects, so I probably won't be able to help any more.

@mskelton No problem. Thanks for your help though ...

Typescript support has been added in v0.9.0. Thanks @mskelton for your help.