Is it possible to combine the functions "associated types" and "union types" to create an expression that accepts the following interface as input:
interface AwaActionTypes {
CLICKLEFT: 'CL';
CLICKRIGHT: 'CR';
SCROLL: 'S';
ZOOM: 'Z';
RESIZE: 'R';
KEYBOARDENTER: 'KE';
KEYBOARDSPACE: 'KS';
OTHER: 'O';
}
And creates a type equivalent to the following union type alias:
type AwaActionType: 'CL' | 'CR' | 'S' | 'Z' | 'R' | 'KE' | 'KS' | 'O';
I tried using combinations keyof, |etc. Didn't land on something that worked. I did not see anything in the handbook .
source
share