RCTAnimatedNode.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * Copyright (c) Facebook, Inc. and its affiliates.
  3. *
  4. * This source code is licensed under the MIT license found in the
  5. * LICENSE file in the root directory of this source tree.
  6. */
  7. #import <Foundation/Foundation.h>
  8. @class RCTNativeAnimatedNodesManager;
  9. @interface RCTAnimatedNode : NSObject
  10. - (instancetype)initWithTag:(NSNumber *)tag
  11. config:(NSDictionary<NSString *, id> *)config NS_DESIGNATED_INITIALIZER;
  12. @property (nonatomic, readonly) NSNumber *nodeTag;
  13. @property (nonatomic, weak) RCTNativeAnimatedNodesManager *manager;
  14. @property (nonatomic, copy, readonly) NSDictionary<NSString *, id> *config;
  15. @property (nonatomic, copy, readonly) NSMapTable<NSNumber *, RCTAnimatedNode *> *childNodes;
  16. @property (nonatomic, copy, readonly) NSMapTable<NSNumber *, RCTAnimatedNode *> *parentNodes;
  17. @property (nonatomic, readonly) BOOL needsUpdate;
  18. -(BOOL)isManagedByFabric;
  19. /**
  20. * Marks a node and its children as needing update.
  21. */
  22. - (void)setNeedsUpdate NS_REQUIRES_SUPER;
  23. /**
  24. * The node will update its value if necessary and only after its parents have updated.
  25. */
  26. - (void)updateNodeIfNecessary NS_REQUIRES_SUPER;
  27. /**
  28. * Where the actual update code lives. Called internally from updateNodeIfNecessary
  29. */
  30. - (void)performUpdate NS_REQUIRES_SUPER;
  31. - (void)addChild:(RCTAnimatedNode *)child NS_REQUIRES_SUPER;
  32. - (void)removeChild:(RCTAnimatedNode *)child NS_REQUIRES_SUPER;
  33. - (void)onAttachedToNode:(RCTAnimatedNode *)parent NS_REQUIRES_SUPER;
  34. - (void)onDetachedFromNode:(RCTAnimatedNode *)parent NS_REQUIRES_SUPER;
  35. - (void)detachNode NS_REQUIRES_SUPER;
  36. @end