Can the features of "mapped types" and "union types" be combined to generate an expression that accepts the specified interface as input:
interface AwaActionTypes {
CLICKLEFT: 'CL';
CLICKRIGHT: 'CR';
SCROLL: 'S';
ZOOM: 'Z';
RESIZE: 'R';
KEYBOARDENTER: 'KE';
KEYBOARDSPACE: 'KS';
OTHER: 'O';
}
This expression should produce a type equivalent to the union type alias shown below:
type AwaActionType: 'CL' | 'CR' | 'S' | 'Z' | 'R' | 'KE' | 'KS' | 'O';
I attempted various combinations involving keyof
, |
, etc. without success. I didn't find any relevant information in the handbook either.