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