/ src / hotkey / constants.ts
constants.ts
 1  export enum HotkeyModifier {
 2  	ctrl = 1 << 0,
 3  	meta = 1 << 1,
 4  	alt = 1 << 2,
 5  	shift = 1 << 3,
 6  }
 7  
 8  export type HotkeyModifierKey = keyof typeof HotkeyModifier;
 9  
10  export const HOTKEY_MODIFIERS = Object.values(HotkeyModifier).filter(v => typeof v === 'number');
11  
12  export const HOTKEY_MODIFIERS_ENTRIES = Object.entries(HotkeyModifier).filter(
13  	(entry): entry is [HotkeyModifierKey, HotkeyModifier] => typeof entry[1] === 'number',
14  );