jakezatecky / d3-funnel

A JavaScript library for rendering funnel charts using the D3.js framework.
http://jakezatecky.github.io/d3-funnel/
MIT License
330 stars 96 forks source link

Typescript declaration #158

Open blpraveen opened 3 years ago

blpraveen commented 3 years ago

I just used with typescript it fails

I created a declaration file index.d.ts inside types/d3-funnel But I get an error declare module 'd3-funnel'

 {
    "compilerOptions": {
      "target": "es5",
      "typeRoots": [ "./types", "./node_modules/@types"],
      "lib": [
        "dom",
        "dom.iterable",
        "esnext"
      ],
      "allowJs": true,
      "skipLibCheck": true,
      "esModuleInterop": true,
      "allowSyntheticDefaultImports": true,
      "strict": true,
      "forceConsistentCasingInFileNames": true,
      "noFallthroughCasesInSwitch": true,
      "module": "esnext",
      "moduleResolution": "node",
      "resolveJsonModule": true,
      "isolatedModules": true,
      "noEmit": true,
      "jsx": "react-jsx"
    },
    "include": [
      "src"
    ],
    "exclude": [
          "./node_modules",
          "./types"
      ]
  }

Type 'RefObject<unknown>' is not assignable to type 'LegacyRef<HTMLDivElement> | undefined'.
  Type 'RefObject<unknown>' is not assignable to type 'RefObject<HTMLDivElement>'.
    Type 'unknown' is not assignable to type 'HTMLDivElement'.  TS2322

    46 |     render() {
    47 |        
  > 48 |        return (<div className="funnel__chart" ref={this.chartRef}></div>);
       |                                               ^
    49 |     }
    50 | }
    51 |