Closed panteluke closed 6 years ago
You can see some examples here: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/b0a6ea017ee6608093c073cbf7ce4ea84ddc0d9e/types/json2csv/json2csv-tests.ts
Can you elaborate a bit on what is unclear to you??
Yes sure. In various examples we can see something like this:
const fields = [{
label: 'Car Name',
value: 'car'
},{
label: 'Price USD',
value: 'price'
}];
const json2csvParser = new Json2csvParser({ fields });
But I cannot figure out the way that I can achieve this through Typescript. Even in the link that you sent me, there is no such case if I'm not mistaken.
So, in your example, how can we set labels as "String", "Number", "Object" for example for interface ExampleObj?
You are right. There is a bug in the Types but it should be fixed with my the PR I just made.
Thank you
Just a small silly question, because I'm puzzled with the type definition. Can you give a simple example where you have an object of class A and you try to convert it to csv? I cannot figure out how you provide opts in the parser constructor.