1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 | #import <UIKit/UIKit.h>
|
9 |
|
10 | #import <React/RCTBridge.h>
|
11 |
|
12 | typedef NS_ENUM(NSInteger, RCTTextEventType)
|
13 | {
|
14 | RCTTextEventTypeFocus,
|
15 | RCTTextEventTypeBlur,
|
16 | RCTTextEventTypeChange,
|
17 | RCTTextEventTypeSubmit,
|
18 | RCTTextEventTypeEnd,
|
19 | RCTTextEventTypeKeyPress
|
20 | };
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 | RCT_EXTERN const NSInteger RCTTextUpdateLagWarningThreshold;
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 | RCT_EXTERN NSString *RCTNormalizeInputEventName(NSString *eventName);
|
34 |
|
35 | @protocol RCTEvent <NSObject>
|
36 | @required
|
37 |
|
38 | @property (nonatomic, strong, readonly) NSNumber *viewTag;
|
39 | @property (nonatomic, copy, readonly) NSString *eventName;
|
40 |
|
41 | - (BOOL)canCoalesce;
|
42 |
|
43 |
|
44 | + (NSString *)moduleDotMethod;
|
45 |
|
46 |
|
47 | - (NSArray *)arguments;
|
48 |
|
49 | @optional
|
50 |
|
51 |
|
52 |
|
53 |
|
54 |
|
55 | @property (nonatomic, assign, readonly) uint16_t coalescingKey;
|
56 | - (id<RCTEvent>)coalesceWithEvent:(id<RCTEvent>)newEvent;
|
57 |
|
58 | @end
|
59 |
|
60 |
|
61 |
|
62 |
|
63 | @protocol RCTEventDispatcherObserver <NSObject>
|
64 |
|
65 |
|
66 |
|
67 |
|
68 |
|
69 | - (void)eventDispatcherWillDispatchEvent:(id<RCTEvent>)event;
|
70 |
|
71 | @end
|
72 |
|
73 |
|
74 |
|
75 |
|
76 |
|
77 |
|
78 | @interface RCTEventDispatcher : NSObject <RCTBridgeModule>
|
79 |
|
80 |
|
81 |
|
82 |
|
83 | - (void)sendAppEventWithName:(NSString *)name body:(id)body
|
84 | __deprecated_msg("Subclass RCTEventEmitter instead");
|
85 |
|
86 |
|
87 |
|
88 |
|
89 | - (void)sendDeviceEventWithName:(NSString *)name body:(id)body
|
90 | __deprecated_msg("Subclass RCTEventEmitter instead");
|
91 |
|
92 |
|
93 |
|
94 |
|
95 | - (void)sendTextEventWithType:(RCTTextEventType)type
|
96 | reactTag:(NSNumber *)reactTag
|
97 | text:(NSString *)text
|
98 | key:(NSString *)key
|
99 | eventCount:(NSInteger)eventCount;
|
100 |
|
101 |
|
102 |
|
103 |
|
104 |
|
105 |
|
106 |
|
107 | - (void)sendEvent:(id<RCTEvent>)event;
|
108 |
|
109 |
|
110 |
|
111 |
|
112 | - (void)addDispatchObserver:(id<RCTEventDispatcherObserver>)observer;
|
113 |
|
114 |
|
115 |
|
116 |
|
117 | - (void)removeDispatchObserver:(id<RCTEventDispatcherObserver>)observer;
|
118 |
|
119 | @end
|
120 |
|
121 | @interface RCTBridge (RCTEventDispatcher)
|
122 |
|
123 | - (RCTEventDispatcher *)eventDispatcher;
|
124 |
|
125 | @end
|