My current challenge involves working with a filter object derived from an OpenAPI spec. The structure of this object is illustrated below:
export interface Filters {
field1: string[]
field2: string[]
field3: boolean
field4: number
}
My goal is to create a new type by selecting specific properties from the filters interface based on their types:
The desired outcome would be something similar to:
export type MultivalueFields = Select<Filters, string[]>
// Resulting type will be 'field1' or 'field2'
I'm curious if there is a built-in solution for this problem or how one could achieve this desired outcome?