Looking for a solution:
interface Details {
id: string;
groups: Group[];
name: string;
total: number;
open: boolean;
debug: boolean;
demo: boolean;
registered: boolean;
}
I'm seeking a way to create an array type with property names from the Details
interface.
For example, ['total', 'open', 'demo']
should be valid.
This was my attempt:
type RequiredFields = { [key in Details]?: string };
Unfortunately, I encountered this TypeScript error:
Type 'Details' is not assignable to type 'string | number | symbol'.
Type 'Details' is not assignable to type 'symbol'.
If you can offer any guidance, I would appreciate it!