diff --git a/packages/react-native/React/Base/RCTBridgeDelegate.h b/packages/react-native/React/Base/RCTBridgeDelegate.h index 0e081964bc2ec2..901531f7933f39 100644 --- a/packages/react-native/React/Base/RCTBridgeDelegate.h +++ b/packages/react-native/React/Base/RCTBridgeDelegate.h @@ -18,7 +18,7 @@ * When running from a locally bundled JS file, this should be a `file://` url * pointing to a path inside the app resources, e.g. `file://.../main.jsbundle`. */ -- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge; +- (NSURL *__nullable)sourceURLForBridge:(RCTBridge *)bridge; @optional diff --git a/packages/react-native/React/Base/RCTBundleURLProvider.h b/packages/react-native/React/Base/RCTBundleURLProvider.h index bd627816167872..79910ecf7c3b69 100644 --- a/packages/react-native/React/Base/RCTBundleURLProvider.h +++ b/packages/react-native/React/Base/RCTBundleURLProvider.h @@ -9,7 +9,7 @@ #import "RCTDefines.h" -RCT_EXTERN NSString *const RCTBundleURLProviderUpdatedNotification; +RCT_EXTERN NSString *_Nonnull const RCTBundleURLProviderUpdatedNotification; RCT_EXTERN const NSUInteger kRCTBundleURLProviderDefaultPort; #if RCT_DEV_MENU | RCT_PACKAGER_LOADING_FUNCTIONALITY @@ -22,6 +22,8 @@ RCT_EXTERN const NSUInteger kRCTBundleURLProviderDefaultPort; RCT_EXTERN void RCTBundleURLProviderAllowPackagerServerAccess(BOOL allowed); #endif +NS_ASSUME_NONNULL_BEGIN + @interface RCTBundleURLProvider : NSObject /** @@ -52,44 +54,44 @@ RCT_EXTERN void RCTBundleURLProviderAllowPackagerServerAccess(BOOL allowed); * The port is optional, if not specified, kRCTBundleURLProviderDefaultPort will be used * The scheme is also optional, if not specified, a default http protocol will be used */ -+ (BOOL)isPackagerRunning:(NSString *)hostPort scheme:(NSString *)scheme; ++ (BOOL)isPackagerRunning:(NSString *)hostPort scheme:(NSString *__nullable)scheme; /** * Returns the jsBundleURL for a given bundle entrypoint and * the fallback offline JS bundle if the packager is not running. */ -- (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot fallbackURLProvider:(NSURL * (^)(void))fallbackURLProvider; +- (NSURL *__nullable)jsBundleURLForBundleRoot:(NSString *)bundleRoot fallbackURLProvider:(NSURL *__nullable (^)(void))fallbackURLProvider; /** * Returns the jsBundleURL for a given split bundle entrypoint in development */ -- (NSURL *)jsBundleURLForSplitBundleRoot:(NSString *)bundleRoot; +- (NSURL *__nullable)jsBundleURLForSplitBundleRoot:(NSString *)bundleRoot; /** * Returns the jsBundleURL for a given bundle entrypoint and * the fallback offline JS bundle if the packager is not running. * if extension is nil, "jsbundle" will be used. */ -- (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot fallbackExtension:(NSString *)extension; +- (NSURL *__nullable)jsBundleURLForBundleRoot:(NSString *)bundleRoot fallbackExtension:(NSString *__nullable)extension; /** * Returns the jsBundleURL for a given bundle entrypoint and * the fallback offline JS bundle if the packager is not running. */ -- (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot; +- (NSURL *__nullable)jsBundleURLForBundleRoot:(NSString *)bundleRoot; /** * Returns the jsBundleURL for a given bundle entrypoint and * the fallback offline JS bundle. If extension is nil, * "jsbundle" will be used. */ -- (NSURL *)jsBundleURLForFallbackExtension:(NSString *)extension; +- (NSURL *__nullable)jsBundleURLForFallbackExtension:(NSString *)extension; /** * Returns the resourceURL for a given bundle entrypoint and * the fallback offline resource file if the packager is not running. */ -- (NSURL *)resourceURLForResourceRoot:(NSString *)root +- (NSURL *__nullable)resourceURLForResourceRoot:(NSString *)root resourceName:(NSString *)name resourceExtension:(NSString *)extension offlineBundle:(NSBundle *)offlineBundle; @@ -124,15 +126,15 @@ RCT_EXTERN void RCTBundleURLProviderAllowPackagerServerAccess(BOOL allowed); * - runModule: When true, will run the main module after defining all modules. This is used in the main bundle but not * in split bundles. */ -+ (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot ++ (NSURL *__nullable)jsBundleURLForBundleRoot:(NSString *)bundleRoot packagerHost:(NSString *)packagerHost enableDev:(BOOL)enableDev enableMinification:(BOOL)enableMinification inlineSourceMap:(BOOL)inlineSourceMap; -+ (NSURL *)jsBundleURLForBundleRoot:(NSString *)bundleRoot ++ (NSURL *__nullable)jsBundleURLForBundleRoot:(NSString *)bundleRoot packagerHost:(NSString *)packagerHost - packagerScheme:(NSString *)scheme + packagerScheme:(NSString *__nullable)scheme enableDev:(BOOL)enableDev enableMinification:(BOOL)enableMinification inlineSourceMap:(BOOL)inlineSourceMap @@ -145,8 +147,8 @@ RCT_EXTERN void RCTBundleURLProviderAllowPackagerServerAccess(BOOL allowed); */ + (NSURL *)resourceURLForResourcePath:(NSString *)path packagerHost:(NSString *)packagerHost - scheme:(NSString *)scheme - query:(NSString *)query + scheme:(NSString *__nullable)scheme + query:(NSString *__nullable)query __deprecated_msg("Use version with queryItems parameter instead"); /** @@ -157,6 +159,8 @@ RCT_EXTERN void RCTBundleURLProviderAllowPackagerServerAccess(BOOL allowed); + (NSURL *)resourceURLForResourcePath:(NSString *)path packagerHost:(NSString *)packagerHost scheme:(NSString *)scheme - queryItems:(NSArray *)queryItems; + queryItems:(NSArray *__nullable)queryItems; @end + +NS_ASSUME_NONNULL_END