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  *  Whether the kernel JS should auto reload an experience after it encounters a fatal JS error.
16  */
17 - (BOOL)homeModuleShouldAutoReloadCurrentTask:(EXHomeModule *)module;
18 
19 /**
20  *  Whether to enable legacy gesture/button for the Expo menu.
21  */
22 - (BOOL)homeModuleShouldEnableLegacyMenuBehavior:(EXHomeModule *)module;
23 - (void)homeModule:(EXHomeModule *)module didSelectEnableLegacyMenuBehavior:(BOOL)isEnabled;
24 
25 /**
26  *  Dictionary of `key` => `user facing label` items to show in the kernel JS dev menu.
27  */
28 - (NSDictionary <NSString *, NSString *> *)devMenuItemsForHomeModule:(EXHomeModule *)module;
29 
30 - (void)homeModule:(EXHomeModule *)module didSelectDevMenuItemWithKey:(NSString *)key;
31 - (void)homeModuleDidSelectHomeDiagnostics:(EXHomeModule *)module;
32 - (void)homeModule:(EXHomeModule *)module didOpenUrl:(NSString *)url;
33 - (void)homeModuleDidSelectRefresh:(EXHomeModule *)module;
34 - (void)homeModuleDidSelectCloseMenu:(EXHomeModule *)module;
35 - (void)homeModuleDidSelectGoToHome:(EXHomeModule *)module;
36 
37 @end
38 
39 @interface EXHomeModule : EXScopedEventEmitter
40 
41 - (void)dispatchJSEvent: (NSString *)eventName
42                    body: (NSDictionary *)eventBody
43               onSuccess: (void (^)(NSDictionary *))success
44               onFailure: (void (^)(NSString *))failure;
45 
46 @end
47