react-papaparse icon indicating copy to clipboard operation
react-papaparse copied to clipboard

Fix typescript type

Open Bunlong opened this issue 4 years ago • 2 comments

Bunlong avatar Jan 26 '22 17:01 Bunlong

Maybe a silly question, but is this to fix the fact that typing doesn't seem to be working right now? Definitely missing this...

ghost avatar Mar 22 '22 17:03 ghost

Are you planning to add exports to all the related types, not only for main declarations? In my case I use readString and to type Error properly in my react state I had to write such a cumbersome thing:

type ParseError = Parameters<
  Parameters<ReturnType<typeof usePapaParse>['readString']>[1]['complete']
>[0]['errors'][number];

ofc that works for now, however (apart from the fact this is very odd chunk of code :)) I have absolutely no guarantee that signature will not change in future versions would be really good to just import that type from react-papaparse module

dr-leevsey avatar Jul 13 '22 09:07 dr-leevsey