In search of defining an interface that allows for specific range of values for the key.
Consider this example:
interface ComparisonOperator {
[operator: string]: [string, string | number];
}
The key can take on values such as >
, >=
, !=
, and so on.
This allows us to construct items like:
{'>', ['field bla', 5]}
However, I am looking to set restrictions on what values the key can have. Is there a way to achieve this?
Thank you