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 - (BOOL)homeModuleShouldFinishNux:(EXHomeModule *)homeModule;
31 - (void)homeModule:(EXHomeModule *)homeModule didFinishNux:(BOOL)isNuxFinished;
32 
33 - (void)homeModule:(EXHomeModule *)module didSelectDevMenuItemWithKey:(NSString *)key;
34 - (void)homeModuleDidSelectHomeDiagnostics:(EXHomeModule *)module;
35 - (void)homeModule:(EXHomeModule *)module didOpenUrl:(NSString *)url;
36 - (void)homeModuleDidSelectRefresh:(EXHomeModule *)module;
37 - (void)homeModuleDidSelectCloseMenu:(EXHomeModule *)module;
38 - (void)homeModuleDidSelectGoToHome:(EXHomeModule *)module;
39 - (void)homeModuleDidSelectQRReader:(EXHomeModule *)module;
40 
41 @end
42 
43 @interface EXHomeModule : EXScopedEventEmitter
44 
45 - (void)dispatchJSEvent: (NSString *)eventName
46                    body: (NSDictionary *)eventBody
47               onSuccess: (void (^)(NSDictionary *))success
48               onFailure: (void (^)(NSString *))failure;
49 
50 @end
51