Source

externalCode/shakeManagerApi.js

  1. /**
  2. * @typedef {Object} ShakeMenuItem
  3. * @property { string } title
  4. * @property { Function } onPress
  5. */
  6. /**
  7. * @class
  8. * Shake Manager Hooks.
  9. * Instance name: shakeManagerApi
  10. You can use it to customize and manage the shake menu items.
  11. * @example
  12. * externalCodeSetup.shakeManagerApi.METHOD_NAME
  13. */
  14. export class ShakeManagerApi {
  15. menuItems = [];
  16. /**
  17. * It adds custom menu items to the shake menu
  18. * @param {ShakeMenuItem} _menuItems
  19. * @example
  20. * const menuItems = [{ title: "Say hi to user", onPress: () => Alert.alert("Hello user!")}]
  21. *
  22. * externalCodeSetup.shakeManagerApi.addMenuItems(menuItems)
  23. */
  24. addMenuItems = _menuItems => (this.menuItems = _menuItems);
  25. }