forked from facebook/react-native
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRCTDevMenu.h
More file actions
110 lines (84 loc) · 2.62 KB
/
RCTDevMenu.h
File metadata and controls
110 lines (84 loc) · 2.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#import <UIKit/UIKit.h>
#import <React/RCTBridge.h>
#import <React/RCTBridgeModule.h>
#import <React/RCTDefines.h>
#if RCT_DEV_MENU
RCT_EXTERN NSString *const RCTShowDevMenuNotification;
#endif
@class RCTDevMenuItem;
/**
* Developer menu, useful for exposing extra functionality when debugging.
*/
@interface RCTDevMenu : NSObject
/**
* Deprecated, use RCTDevSettings instead.
*/
@property (nonatomic, assign) BOOL shakeToShow DEPRECATED_ATTRIBUTE;
/**
* Deprecated, use RCTDevSettings instead.
*/
@property (nonatomic, assign) BOOL profilingEnabled DEPRECATED_ATTRIBUTE;
/**
* Deprecated, use RCTDevSettings instead.
*/
@property (nonatomic, assign) BOOL liveReloadEnabled DEPRECATED_ATTRIBUTE;
/**
* Deprecated, use RCTDevSettings instead.
*/
@property (nonatomic, assign) BOOL hotLoadingEnabled DEPRECATED_ATTRIBUTE;
/**
* Presented items in development menu
*/
@property (nonatomic, copy, readonly) NSArray<RCTDevMenuItem *> *presentedItems;
/**
* Detect if actions sheet (development menu) is shown
*/
- (BOOL)isActionSheetShown;
/**
* Manually show the dev menu (can be called from JS).
*/
- (void)show;
/**
* Deprecated, use `RCTReloadCommand` instead.
*/
- (void)reload DEPRECATED_ATTRIBUTE;
/**
* Deprecated. Use the `-addItem:` method instead.
*/
- (void)addItem:(NSString *)title handler:(void (^)(void))handler DEPRECATED_ATTRIBUTE;
/**
* Add custom item to the development menu. The handler will be called
* when user selects the item.
*/
- (void)addItem:(RCTDevMenuItem *)item;
@end
typedef NSString * (^RCTDevMenuItemTitleBlock)(void);
/**
* Developer menu item, used to expose additional functionality via the menu.
*/
@interface RCTDevMenuItem : NSObject
/**
* This creates an item with a simple push-button interface, used to trigger an
* action.
*/
+ (instancetype)buttonItemWithTitle:(NSString *)title handler:(dispatch_block_t)handler;
/**
* This creates an item with a simple push-button interface, used to trigger an
* action. getTitleForPresentation is called each time the item is about to be
* presented, and should return the item's title.
*/
+ (instancetype)buttonItemWithTitleBlock:(RCTDevMenuItemTitleBlock)titleBlock handler:(dispatch_block_t)handler;
@end
/**
* This category makes the developer menu instance available via the
* RCTBridge, which is useful for any class that needs to access the menu.
*/
@interface RCTBridge (RCTDevMenu)
@property (nonatomic, readonly) RCTDevMenu *devMenu;
@end