Here's a scenario I'm dealing with:
type FormatList = 'csv' | 'html' | 'xlsx' | 'pdf';
type FormatsMap = Record<Partial<FormatList>, string>;
I want to create a simple object like this:
{ csv: 'A name'}
However, I encounter an issue that says
TS2739: Type '{ csv: string; }' is missing the following properties from type 'ReportFormats': html, xlsx, pdf
Despite indicating it as partial.
Any suggestions on how to address this so the object can have any number of keys, and not all are mandatory?
Appreciate your help!