1 #import <React/RCTBridgeModule.h> 2 #import <React/RCTUIManager.h> 3 4 #ifdef RCT_NEW_ARCH_ENABLED 5 #import <React/RCTSurfacePresenterStub.h> 6 #endif 7 8 @class REAModule; 9 10 typedef void (^REAOnAnimationCallback)(CADisplayLink *displayLink); 11 typedef void (^REANativeAnimationOp)(RCTUIManager *uiManager); 12 typedef void (^REAEventHandler)(NSString *eventName, id<RCTEvent> event); 13 14 #ifdef RCT_NEW_ARCH_ENABLED 15 typedef void (^REAPerformOperations)(); 16 #endif 17 18 @interface REANodesManager : NSObject 19 20 @property (nonatomic, weak, nullable) RCTUIManager *uiManager; 21 @property (nonatomic, weak, nullable) REAModule *reanimatedModule; 22 @property (nonatomic, readonly) CFTimeInterval currentAnimationTimestamp; 23 24 @property (nonatomic, nullable) NSSet<NSString *> *uiProps; 25 @property (nonatomic, nullable) NSSet<NSString *> *nativeProps; 26 27 #ifdef RCT_NEW_ARCH_ENABLED 28 - (nonnull instancetype)initWithModule:(REAModule *)reanimatedModule 29 bridge:(RCTBridge *)bridge 30 surfacePresenter:(id<RCTSurfacePresenterStub>)surfacePresenter; 31 #else 32 - (instancetype)initWithModule:(REAModule *)reanimatedModule uiManager:(RCTUIManager *)uiManager; 33 #endif 34 - (void)invalidate; 35 - (void)operationsBatchDidComplete; 36 37 - (void)postOnAnimation:(REAOnAnimationCallback)clb; 38 - (void)registerEventHandler:(REAEventHandler)eventHandler; 39 - (void)dispatchEvent:(id<RCTEvent>)event; 40 41 #ifdef RCT_NEW_ARCH_ENABLED 42 - (void)setSurfacePresenter:(id<RCTSurfacePresenterStub>)surfacePresenter; 43 - (void)registerPerformOperations:(REAPerformOperations)performOperations; 44 - (void)synchronouslyUpdateViewOnUIThread:(nonnull NSNumber *)viewTag props:(nonnull NSDictionary *)uiProps; 45 #else 46 - (void)configureUiProps:(nonnull NSSet<NSString *> *)uiPropsSet 47 andNativeProps:(nonnull NSSet<NSString *> *)nativePropsSet; 48 - (void)updateProps:(nonnull NSDictionary *)props 49 ofViewWithTag:(nonnull NSNumber *)viewTag 50 withName:(nonnull NSString *)viewName; 51 - (void)maybeFlushUpdateBuffer; 52 - (void)enqueueUpdateViewOnNativeThread:(nonnull NSNumber *)reactTag 53 viewName:(NSString *)viewName 54 nativeProps:(NSMutableDictionary *)nativeProps 55 trySynchronously:(BOOL)trySync; 56 - (NSString *)obtainProp:(nonnull NSNumber *)viewTag propName:(nonnull NSString *)propName; 57 #endif 58 - (void)maybeFlushUIUpdatesQueue; 59 60 @end 61