1 // Copyright 2015-present 650 Industries. All rights reserved.
2 
3 @objc
4 public protocol DevMenuExtensionSettingsProtocol {
5   func wasRunOnDevelopmentBridge() -> Bool
6 }
7 
8 /**
9  A protocol for React Native bridge modules that want to provide their own dev menu actions.
10  */
11 @objc
12 public protocol DevMenuExtensionProtocol {
13   /**
14    Returns a name of the module and the extension. Required by `RCTBridgeModule`.
15    This function is optional because otherwise we end up with linker warning:
16    `method '+moduleName' in category from /.../expo-dev-menu/libexpo-dev-menu.a(DevMenuExtensions-....o)
17    overrides method from class in /.../expo-dev-menu/libexpo-dev-menu.a(DevMenuExtensions-....o`
18 
19    So we assume that this method will be implemented by `RCTBridgeModule`.
20    In theory we can remove it. However, we leave it  to get easy access to the module name.
21    */
22   @objc
23   optional static func moduleName() -> String!
24 
25   /**
26    Returns an array of the dev menu items to show.
27    It's called only once for the extension instance — results are being cached on first dev menu launch.
28    */
29   @objc
30   optional func devMenuItems(_ settings: DevMenuExtensionSettingsProtocol) -> DevMenuItemsContainerProtocol?
31 
32   @objc
33   optional func devMenuScreens(_ settings: DevMenuExtensionSettingsProtocol) -> [DevMenuScreen]?
34 
35   @objc
36   optional func devMenuDataSources(_ settings: DevMenuExtensionSettingsProtocol) -> [DevMenuDataSourceProtocol]?
37 }
38 
39