RCTAnimationDriver.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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 <CoreGraphics/CoreGraphics.h>
  8. #import <Foundation/Foundation.h>
  9. #import <React/RCTBridgeModule.h>
  10. static CGFloat RCTSingleFrameInterval = (CGFloat)(1.0 / 60.0);
  11. @class RCTValueAnimatedNode;
  12. NS_ASSUME_NONNULL_BEGIN
  13. @protocol RCTAnimationDriver <NSObject>
  14. @property (nonatomic, readonly) NSNumber *animationId;
  15. @property (nonatomic, readonly) RCTValueAnimatedNode *valueNode;
  16. @property (nonatomic, readonly) BOOL animationHasBegun;
  17. @property (nonatomic, readonly) BOOL animationHasFinished;
  18. - (instancetype)initWithId:(NSNumber *)animationId
  19. config:(NSDictionary *)config
  20. forNode:(RCTValueAnimatedNode *)valueNode
  21. callBack:(nullable RCTResponseSenderBlock)callback;
  22. - (void)startAnimation;
  23. - (void)stepAnimationWithTime:(NSTimeInterval)currentTime;
  24. - (void)stopAnimation;
  25. - (void)resetAnimationConfig:(NSDictionary *)config;
  26. NS_ASSUME_NONNULL_END
  27. @end