RCTScheduler.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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 <UIKit/UIKit.h>
  8. #import <memory>
  9. #import <React/RCTPrimitives.h>
  10. #import <react/core/ComponentDescriptor.h>
  11. #import <react/core/LayoutConstraints.h>
  12. #import <react/core/LayoutContext.h>
  13. #import <react/mounting/MountingCoordinator.h>
  14. #import <react/uimanager/ComponentDescriptorFactory.h>
  15. #import <react/uimanager/SchedulerToolbox.h>
  16. #import <react/utils/ContextContainer.h>
  17. NS_ASSUME_NONNULL_BEGIN
  18. @class RCTMountingManager;
  19. /**
  20. * Exactly same semantic as `facebook::react::SchedulerDelegate`.
  21. */
  22. @protocol RCTSchedulerDelegate
  23. - (void)schedulerDidFinishTransaction:(facebook::react::MountingCoordinator::Shared const &)mountingCoordinator;
  24. - (void)schedulerDidDispatchCommand:(facebook::react::ShadowView const &)shadowView
  25. commandName:(std::string const &)commandName
  26. args:(folly::dynamic const)args;
  27. @end
  28. /**
  29. * `facebook::react::Scheduler` as an Objective-C class.
  30. */
  31. @interface RCTScheduler : NSObject
  32. @property (atomic, weak, nullable) id<RCTSchedulerDelegate> delegate;
  33. - (instancetype)initWithToolbox:(facebook::react::SchedulerToolbox)toolbox;
  34. - (void)startSurfaceWithSurfaceId:(facebook::react::SurfaceId)surfaceId
  35. moduleName:(NSString *)moduleName
  36. initialProps:(NSDictionary *)initialProps
  37. layoutConstraints:(facebook::react::LayoutConstraints)layoutConstraints
  38. layoutContext:(facebook::react::LayoutContext)layoutContext;
  39. - (void)stopSurfaceWithSurfaceId:(facebook::react::SurfaceId)surfaceId;
  40. - (CGSize)measureSurfaceWithLayoutConstraints:(facebook::react::LayoutConstraints)layoutConstraints
  41. layoutContext:(facebook::react::LayoutContext)layoutContext
  42. surfaceId:(facebook::react::SurfaceId)surfaceId;
  43. - (void)constraintSurfaceLayoutWithLayoutConstraints:(facebook::react::LayoutConstraints)layoutConstraints
  44. layoutContext:(facebook::react::LayoutContext)layoutContext
  45. surfaceId:(facebook::react::SurfaceId)surfaceId;
  46. - (facebook::react::ComponentDescriptor const *)findComponentDescriptorByHandle_DO_NOT_USE_THIS_IS_BROKEN:
  47. (facebook::react::ComponentHandle)handle;
  48. - (facebook::react::MountingCoordinator::Shared)mountingCoordinatorWithSurfaceId:(facebook::react::SurfaceId)surfaceId;
  49. @end
  50. NS_ASSUME_NONNULL_END