|
14 | 14 | @protocol RCTBridgeMethod;
|
15 | 15 | @class RCTModuleRegistry;
|
16 | 16 | @class RCTViewRegistry;
|
| 17 | +@class RCTBundleManager; |
17 | 18 |
|
18 | 19 | /**
|
19 | 20 | * The type of a block that is capable of sending a response to a bridged
|
@@ -135,6 +136,16 @@ RCT_EXTERN_C_END
|
135 | 136 | */
|
136 | 137 | @property (nonatomic, weak, readwrite) RCTViewRegistry *viewRegistry_DEPRECATED;
|
137 | 138 |
|
| 139 | +/** |
| 140 | + * A reference to the RCTBundleManager. Useful for modules that need to read |
| 141 | + * or write to the app's bundle URL. |
| 142 | + * |
| 143 | + * To implement this in your module, just add `@synthesize bundleManager = |
| 144 | + * _bundleManager;`. If using Swift, add `@objc var bundleManager: |
| 145 | + * RCTBundleManager!` to your module. |
| 146 | + */ |
| 147 | +@property (nonatomic, weak, readwrite) RCTBundleManager *bundleManager; |
| 148 | + |
138 | 149 | /**
|
139 | 150 | * A reference to the RCTBridge. Useful for modules that require access
|
140 | 151 | * to bridge features, such as sending events or making JS calls. This
|
@@ -406,6 +417,19 @@ RCT_EXTERN_C_END
|
406 | 417 | - (id)moduleForName:(const char *)moduleName lazilyLoadIfNecessary:(BOOL)lazilyLoad;
|
407 | 418 | @end
|
408 | 419 |
|
| 420 | +typedef void (^RCTBridgelessBundleURLSetter)(NSURL *bundleURL); |
| 421 | +typedef NSURL * (^RCTBridgelessBundleURLGetter)(); |
| 422 | + |
| 423 | +/** |
| 424 | + * A class that allows NativeModules/TurboModules to read/write the bundleURL, with or without the bridge. |
| 425 | + */ |
| 426 | +@interface RCTBundleManager : NSObject |
| 427 | +- (void)setBridge:(RCTBridge *)bridge; |
| 428 | +- (void)setBridgelessBundleURLGetter:(RCTBridgelessBundleURLGetter)getter |
| 429 | + andSetter:(RCTBridgelessBundleURLSetter)setter; |
| 430 | +@property NSURL *bundleURL; |
| 431 | +@end |
| 432 | + |
409 | 433 | typedef UIView * (^RCTBridgelessComponentViewProvider)(NSNumber *);
|
410 | 434 |
|
411 | 435 | /**
|
|
0 commit comments