選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

functions.ts 936B

12345678910111213141516171819202122232425262728293031
  1. import { IReduxState } from '../app/types';
  2. /**
  3. * Returns whether or not the keyboard shortcuts are enabled.
  4. *
  5. * @param {Object} state - The redux state.
  6. * @returns {boolean} - Whether or not the keyboard shortcuts are enabled.
  7. */
  8. export function areKeyboardShortcutsEnabled(state: IReduxState) {
  9. return state['features/keyboard-shortcuts'].enabled;
  10. }
  11. /**
  12. * Returns the keyboard shortcuts map.
  13. *
  14. * @param {Object} state - The redux state.
  15. * @returns {Map} - The keyboard shortcuts map.
  16. */
  17. export function getKeyboardShortcuts(state: IReduxState) {
  18. return state['features/keyboard-shortcuts'].shortcuts;
  19. }
  20. /**
  21. * Returns the keyboard shortcuts help descriptions.
  22. *
  23. * @param {Object} state - The redux state.
  24. * @returns {Map} - The keyboard shortcuts help descriptions.
  25. */
  26. export function getKeyboardShortcutsHelpDescriptions(state: IReduxState) {
  27. return state['features/keyboard-shortcuts'].shortcutsHelp;
  28. }