mirror of
https://github.com/status-im/react-native.git
synced 2025-02-23 06:38:13 +00:00
Summary: Each app may provide different impl for its runtime specific behaviors, then Fabric and other new infra can share the same config instance to configure stuffs. Reviewed By: sahrens Differential Revision: D13290319 fbshipit-source-id: 30e3eeedc6ff6ef250ed233b27e38cb7c1062b55
81 lines
2.1 KiB
Objective-C
81 lines
2.1 KiB
Objective-C
/**
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
#import <UIKit/UIKit.h>
|
|
#import <memory>
|
|
|
|
#import <React/RCTBridge.h>
|
|
#import <React/RCTComponentViewFactory.h>
|
|
#import <React/RCTPrimitives.h>
|
|
#import <react/config/ReactNativeConfig.h>
|
|
|
|
NS_ASSUME_NONNULL_BEGIN
|
|
|
|
@class RCTFabricSurface;
|
|
@class RCTMountingManager;
|
|
|
|
/**
|
|
* Coordinates presenting of React Native Surfaces and represents application
|
|
* facing interface of running React Native core.
|
|
* SurfacePresenter incapsulates a bridge object inside and discourage direct
|
|
* access to it.
|
|
*/
|
|
@interface RCTSurfacePresenter : NSObject
|
|
|
|
- (instancetype)initWithBridge:(RCTBridge *)bridge
|
|
config:(std::shared_ptr<const facebook::react::ReactNativeConfig>)config;
|
|
|
|
@property (nonatomic, readonly) RCTComponentViewFactory *componentViewFactory;
|
|
|
|
@end
|
|
|
|
@interface RCTSurfacePresenter (Surface)
|
|
|
|
/**
|
|
* Surface uses those methods to register itself in the Presenter.
|
|
* Registering initiates running, rendering and mounting processes.
|
|
*/
|
|
- (void)registerSurface:(RCTFabricSurface *)surface;
|
|
- (void)unregisterSurface:(RCTFabricSurface *)surface;
|
|
- (void)setProps:(NSDictionary *)props
|
|
surface:(RCTFabricSurface *)surface;
|
|
|
|
- (nullable RCTFabricSurface *)surfaceForRootTag:(ReactTag)rootTag;
|
|
|
|
/**
|
|
* Measures the Surface with given constraints.
|
|
*/
|
|
- (CGSize)sizeThatFitsMinimumSize:(CGSize)minimumSize
|
|
maximumSize:(CGSize)maximumSize
|
|
surface:(RCTFabricSurface *)surface;
|
|
|
|
/**
|
|
* Sets `minimumSize` and `maximumSize` layout constraints for the Surface.
|
|
*/
|
|
- (void)setMinimumSize:(CGSize)minimumSize
|
|
maximumSize:(CGSize)maximumSize
|
|
surface:(RCTFabricSurface *)surface;
|
|
|
|
@end
|
|
|
|
@interface RCTSurfacePresenter (Deprecated)
|
|
|
|
/**
|
|
* Returns a underlying bridge.
|
|
*/
|
|
- (RCTBridge *)bridge_DO_NOT_USE;
|
|
|
|
@end
|
|
|
|
@interface RCTBridge (Deprecated)
|
|
|
|
@property (nonatomic) RCTSurfacePresenter *surfacePresenter;
|
|
|
|
@end
|
|
|
|
NS_ASSUME_NONNULL_END
|