3
I have that class Item:
class Item {
nome: string;
idade: number;
}
And that interface ConfItem:
interface ConfItem<TypeItem> {
titulo: string;
}
How do I make for the title in ConfItem accepted only as a string value keys of Item which is received by TypeItem?
I need something like this:
interface ConfItem<TypeItem> {
titulo: 'nome' | 'idade'
}
But it has to be dynamic, because ConfItem will be generic, and therefore can receive any TypeItem.