diff --git a/packages/react-native/Libraries/Network/RCTHTTPRequestHandler.h b/packages/react-native/Libraries/Network/RCTHTTPRequestHandler.h index 15d986e529c..7c86b27bae0 100644 --- a/packages/react-native/Libraries/Network/RCTHTTPRequestHandler.h +++ b/packages/react-native/Libraries/Network/RCTHTTPRequestHandler.h @@ -8,12 +8,14 @@ #import #import +NS_ASSUME_NONNULL_BEGIN + typedef NSURLSessionConfiguration *_Nullable (^NSURLSessionConfigurationProvider)(void); /** * The block provided via this function will provide the NSURLSessionConfiguration for all HTTP requests made by the * app. */ -RCT_EXTERN void RCTSetCustomNSURLSessionConfigurationProvider(NSURLSessionConfigurationProvider /*provider*/); +RCT_EXTERN void RCTSetCustomNSURLSessionConfigurationProvider(NSURLSessionConfigurationProvider _Nullable /*provider*/); typedef NSURLRequest *_Nullable (^RCTHTTPRequestInterceptor)(NSURLRequest *request); /** @@ -21,7 +23,7 @@ typedef NSURLRequest *_Nullable (^RCTHTTPRequestInterceptor)(NSURLRequest *reque * they are sent. Return a modified request to override, or nil to use the * original request unchanged. */ -RCT_EXTERN void RCTSetCustomHTTPRequestInterceptor(RCTHTTPRequestInterceptor /*interceptor*/); +RCT_EXTERN void RCTSetCustomHTTPRequestInterceptor(RCTHTTPRequestInterceptor _Nullable /*interceptor*/); /** * This is the default RCTURLRequestHandler implementation for HTTP requests. @@ -29,3 +31,5 @@ RCT_EXTERN void RCTSetCustomHTTPRequestInterceptor(RCTHTTPRequestInterceptor /*i @interface RCTHTTPRequestHandler : NSObject @end + +NS_ASSUME_NONNULL_END diff --git a/packages/react-native/React/Base/RCTMultipartDataTask.h b/packages/react-native/React/Base/RCTMultipartDataTask.h index 9b94a260a90..b161bf33b32 100644 --- a/packages/react-native/React/Base/RCTMultipartDataTask.h +++ b/packages/react-native/React/Base/RCTMultipartDataTask.h @@ -10,11 +10,13 @@ #import #import +NS_ASSUME_NONNULL_BEGIN + typedef void (^RCTMultipartDataTaskCallback)( NSInteger statusCode, - NSDictionary *headers, - NSData *content, - NSError *error, + NSDictionary *_Nullable headers, + NSData *_Nullable content, + NSError *_Nullable error, BOOL done); typedef NSURLRequest *_Nullable (^RCTMultipartDataTaskRequestInterceptor)(NSURLRequest *request); @@ -23,14 +25,17 @@ typedef NSURLRequest *_Nullable (^RCTMultipartDataTaskRequestInterceptor)(NSURLR * requests before they are sent. Return a modified request to override, or nil * to use the original request unchanged. */ -RCT_EXTERN void RCTSetCustomMultipartDataTaskRequestInterceptor(RCTMultipartDataTaskRequestInterceptor /*interceptor*/); +RCT_EXTERN void RCTSetCustomMultipartDataTaskRequestInterceptor( + RCTMultipartDataTaskRequestInterceptor _Nullable /*interceptor*/); @interface RCTMultipartDataTask : NSObject - (instancetype)initWithURL:(NSURL *)url partHandler:(RCTMultipartDataTaskCallback)partHandler - progressHandler:(RCTMultipartProgressCallback)progressHandler; + progressHandler:(nullable RCTMultipartProgressCallback)progressHandler; - (void)startTask; @end + +NS_ASSUME_NONNULL_END diff --git a/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api b/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api index 483efc9b46d..cd7cd6ba81f 100644 --- a/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api @@ -1410,7 +1410,7 @@ interface RCTMountingManager : public NSObject { } interface RCTMultipartDataTask : public NSObject { - public virtual instancetype initWithURL:partHandler:progressHandler:(NSURL* url, RCTMultipartDataTaskCallback partHandler, RCTMultipartProgressCallback progressHandler); + public virtual instancetype initWithURL:partHandler:progressHandler:(NSURL* url, RCTMultipartDataTaskCallback partHandler, _Nullable RCTMultipartProgressCallback progressHandler); public virtual void startTask(); } diff --git a/scripts/cxx-api/api-snapshots/ReactAppleFrameworksCxx.api b/scripts/cxx-api/api-snapshots/ReactAppleFrameworksCxx.api index b1f98e0f87f..a21ebf06823 100644 --- a/scripts/cxx-api/api-snapshots/ReactAppleFrameworksCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAppleFrameworksCxx.api @@ -1453,7 +1453,7 @@ interface RCTMountingManager : public NSObject { } interface RCTMultipartDataTask : public NSObject { - public virtual instancetype initWithURL:partHandler:progressHandler:(NSURL* url, RCTMultipartDataTaskCallback partHandler, RCTMultipartProgressCallback progressHandler); + public virtual instancetype initWithURL:partHandler:progressHandler:(NSURL* url, RCTMultipartDataTaskCallback partHandler, _Nullable RCTMultipartProgressCallback progressHandler); public virtual void startTask(); } diff --git a/scripts/cxx-api/api-snapshots/ReactAppleNewarchCxx.api b/scripts/cxx-api/api-snapshots/ReactAppleNewarchCxx.api index e9ea4c1f053..aab9559c8f3 100644 --- a/scripts/cxx-api/api-snapshots/ReactAppleNewarchCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAppleNewarchCxx.api @@ -1410,7 +1410,7 @@ interface RCTMountingManager : public NSObject { } interface RCTMultipartDataTask : public NSObject { - public virtual instancetype initWithURL:partHandler:progressHandler:(NSURL* url, RCTMultipartDataTaskCallback partHandler, RCTMultipartProgressCallback progressHandler); + public virtual instancetype initWithURL:partHandler:progressHandler:(NSURL* url, RCTMultipartDataTaskCallback partHandler, _Nullable RCTMultipartProgressCallback progressHandler); public virtual void startTask(); } diff --git a/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api b/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api index 57197975be4..47e70d959eb 100644 --- a/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api @@ -1410,7 +1410,7 @@ interface RCTMountingManager : public NSObject { } interface RCTMultipartDataTask : public NSObject { - public virtual instancetype initWithURL:partHandler:progressHandler:(NSURL* url, RCTMultipartDataTaskCallback partHandler, RCTMultipartProgressCallback progressHandler); + public virtual instancetype initWithURL:partHandler:progressHandler:(NSURL* url, RCTMultipartDataTaskCallback partHandler, _Nullable RCTMultipartProgressCallback progressHandler); public virtual void startTask(); }