Is it possible to have a condition inside of an interface declaration in TypeScript. What I'm looking for is a way to say, based on the value of the first key, the second key can be these values.
Example (non functioning):
interface getSublistValue {
/** The internal ID of the sublist. */
sublistId: 'item' | 'partners';
/** The internal ID of a sublist field. */
if (this.sublistId === 'item') {
fieldId: 'itemname' | 'quantity';
}
if (this.sublistId === 'partners') {
fieldId: 'partnername' | 'location';
}
}