it only allows the type of value from field?
type Match<T extends {}> = {
query: Array<
[keyof T, any]
>;
};
For example:
{
foo: string;
bar: number;
}
{
query: [["bar", <only allow number here]]
}
Do you need a higher order type?
I don't understand where you get the { foo, bar } interface from, since you want it to be generic
Обсуждают сегодня