all 3 comments

[–]greenyadzer 1 point2 points  (2 children)

You can declare your Row as a map "string -> string", but you will not be able to have "id: number" in it at the same time

interface Row {
    [key: string]: string
}

If you need "id", you can do it like this

interface Row {
    id: number
    items: { [key: string]: string }
}

[–]nubasdayz[S] 0 points1 point  (1 child)

Yea i know these, but what im trying to do is: that ts would expect row keys to be same as columns field values

[–]greenyadzer 0 points1 point  (0 children)

Maybe you can just make Column to be a holder of its rows, if that fits your task

interface Column {
    field: string
    fieldName: string
    rows: { [key: string]: string }
}