2018-04-10 16:37:06 -07:00
|
|
|
/**
|
2018-09-11 15:27:47 -07:00
|
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
2018-04-10 16:37:06 -07:00
|
|
|
*
|
|
|
|
* 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>
|
2018-11-25 22:15:00 -08:00
|
|
|
#import <React/RCTComponentViewFactory.h>
|
2018-06-14 20:39:44 -07:00
|
|
|
#import <React/RCTPrimitives.h>
|
2018-12-05 15:00:34 -08:00
|
|
|
#import <react/config/ReactNativeConfig.h>
|
2018-04-10 16:37:06 -07:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2018-12-05 15:00:34 -08:00
|
|
|
- (instancetype)initWithBridge:(RCTBridge *)bridge
|
|
|
|
config:(std::shared_ptr<const facebook::react::ReactNativeConfig>)config;
|
2018-04-10 16:37:06 -07:00
|
|
|
|
2018-11-25 22:15:00 -08:00
|
|
|
@property (nonatomic, readonly) RCTComponentViewFactory *componentViewFactory;
|
|
|
|
|
2018-04-10 16:37:06 -07:00
|
|
|
@end
|
|
|
|
|
2018-05-08 22:56:27 -07:00
|
|
|
@interface RCTSurfacePresenter (Surface)
|
2018-04-10 16:37:06 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 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;
|
2018-09-26 10:01:42 -07:00
|
|
|
- (void)setProps:(NSDictionary *)props
|
|
|
|
surface:(RCTFabricSurface *)surface;
|
|
|
|
|
2018-06-14 20:39:44 -07:00
|
|
|
- (nullable RCTFabricSurface *)surfaceForRootTag:(ReactTag)rootTag;
|
2018-04-10 16:37:06 -07:00
|
|
|
|
2018-05-08 22:56:27 -07:00
|
|
|
/**
|
|
|
|
* 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.
|
|
|
|
*/
|
2018-10-09 16:25:03 -07:00
|
|
|
- (void)setMinimumSize:(CGSize)minimumSize
|
2018-05-08 22:56:27 -07:00
|
|
|
maximumSize:(CGSize)maximumSize
|
|
|
|
surface:(RCTFabricSurface *)surface;
|
2018-06-14 20:39:44 -07:00
|
|
|
|
2018-04-10 16:37:06 -07:00
|
|
|
@end
|
|
|
|
|
|
|
|
@interface RCTSurfacePresenter (Deprecated)
|
|
|
|
|
2018-08-01 15:23:06 -07:00
|
|
|
/**
|
|
|
|
* Returns a underlying bridge.
|
|
|
|
*/
|
|
|
|
- (RCTBridge *)bridge_DO_NOT_USE;
|
|
|
|
|
2018-04-10 16:37:06 -07:00
|
|
|
@end
|
|
|
|
|
2018-10-29 13:02:27 -07:00
|
|
|
@interface RCTBridge (Deprecated)
|
2018-04-10 16:37:06 -07:00
|
|
|
|
2018-10-29 13:02:27 -07:00
|
|
|
@property (nonatomic) RCTSurfacePresenter *surfacePresenter;
|
2018-04-10 16:37:06 -07:00
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
NS_ASSUME_NONNULL_END
|