1 // Copyright 2015-present 650 Industries. All rights reserved. 2 3 #import "EXScopedEventEmitter.h" 4 5 @class EXHomeModule; 6 7 @protocol EXHomeModuleDelegate <NSObject> 8 9 /** 10 * Whether the kernel JS should show any devtools UI or respond to devtools commands. 11 */ 12 - (BOOL)homeModuleShouldEnableDevtools:(EXHomeModule *)module; 13 14 /** 15 * Dictionary of `key` => `user facing label` items to show in the kernel JS dev menu. 16 */ 17 - (NSDictionary <NSString *, NSString *> *)devMenuItemsForHomeModule:(EXHomeModule *)module; 18 19 - (BOOL)homeModuleShouldFinishNux:(EXHomeModule *)homeModule; 20 - (void)homeModule:(EXHomeModule *)homeModule didFinishNux:(BOOL)isNuxFinished; 21 22 - (void)homeModule:(EXHomeModule *)module didSelectDevMenuItemWithKey:(NSString *)key; 23 - (void)homeModule:(EXHomeModule *)module didOpenUrl:(NSString *)url; 24 - (void)homeModuleDidSelectRefresh:(EXHomeModule *)module; 25 - (void)homeModuleDidSelectGoToHome:(EXHomeModule *)module; 26 - (void)homeModuleDidSelectQRReader:(EXHomeModule *)module; 27 28 @end 29 30 @interface EXHomeModule : EXScopedEventEmitter 31 32 - (void)dispatchJSEvent: (NSString *)eventName 33 body: (NSDictionary *)eventBody 34 onSuccess: (void (^)(NSDictionary *))success 35 onFailure: (void (^)(NSString *))failure; 36 37 - (void)requestToCloseDevMenu; 38 39 @end 40