I am working with an Interface
export interface ChartDataResponseI {
consumption: string
generation: string
measure_name: string
point_delivery_number: string
self_coverage: string
time: string
}
My goal is to create a generic object property for point_delivery_number
, if possible
The updated interface should be structured like this:
export interface ChartDataResponseI<T> {
consumption: string
generation: string
measure_name: string
[T]: string
self_coverage: string
time: string
}
This way, I can specify the key like in these examples:
ChartDataResponse<"point_delivery_number">
or
ChartDataResponse<"community_number">