RCTSurfacePresenterStub.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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 <objc/runtime.h>
  8. #import <React/RCTBridge.h>
  9. NS_ASSUME_NONNULL_BEGIN
  10. // TODO: Eventually this should go away and files should just include RCTSurfacePresenter.h, but
  11. // that pulls in all of fabric which doesn't compile in open source yet, so we mirror the protocol
  12. // and duplicate the category here for now.
  13. @protocol RCTSurfacePresenterObserver <NSObject>
  14. @optional
  15. - (void)willMountComponentsWithRootTag:(NSInteger)rootTag;
  16. - (void)didMountComponentsWithRootTag:(NSInteger)rootTag;
  17. @end
  18. @protocol RCTSurfacePresenterStub <NSObject>
  19. - (BOOL)synchronouslyUpdateViewOnUIThread:(NSNumber *)reactTag props:(NSDictionary *)props;
  20. - (void)addObserver:(id<RCTSurfacePresenterObserver>)observer;
  21. - (void)removeObserver:(id<RCTSurfacePresenterObserver>)observer;
  22. @end
  23. @interface RCTBridge (RCTSurfacePresenterStub)
  24. - (id<RCTSurfacePresenterStub>)surfacePresenter;
  25. - (void)setSurfacePresenter:(id<RCTSurfacePresenterStub>)presenter;
  26. @end
  27. NS_ASSUME_NONNULL_END