Bunlong / react-papaparse

react-papaparse is the fastest in-browser CSV (or delimited text) parser for React. It is full of useful features such as CSVReader, CSVDownloader, readString, jsonToCSV, readRemoteFile, ... etc.
https://react-papaparse.js.org
MIT License
372 stars 62 forks source link

Typescript definition support #9

Closed apoorvmote closed 4 years ago

apoorvmote commented 4 years ago

I get following error when I import

Could not find a declaration file for module 'react-papaparse'. '/home/apoorvmote/import-export/node_modules/react-papaparse/dist/index.js' implicitly has an 'any' type.
  Try `npm install @types/react-papaparse` if it exists or add a new declaration (.d.ts) file containing `declare module 'react-papaparse';`ts(7016)
AgmarTorres commented 4 years ago

Please, try this in package.json : Update: "main": "dist/index.js", To: "main": "dist/index"

apoorvmote commented 4 years ago

I am using 2 different other libraries at the moment. One for reading csv and one for exporting csv. They both have typescript support. But would love to just use one instead of two. So not looking for hacky solution. I will wait for @types/react-papaparse

Bunlong commented 4 years ago

@apoorvmote @AgmarTorres react-papaparse v3.2.1 has been released which support both JavaScript & TypeScript. Please kindly check! Thanks!

Bunlong commented 4 years ago

@apoorvmote @AgmarTorres Could we close this issue? Thanks!