mirror of
https://github.com/facebook/react-native.git
synced 2026-11-18 20:19:07 +00:00
xplat/js/react-native-github/packages/react-native/Libraries/Image/RCTImageStoreManager.mm (#57842)
Summary: Pull Request resolved: https://github.com/react/react-native/pull/57842 ...build_codegen_spec to generate the NativeImageStoreIOSSpec protocol and confirmed the module is a TurboModule. 2. Located and quoted the generated protocol signatures (all args NSString */RCTResponseSenderBlock). 3. Ran apply_cast_mod, which converted all four RCT_EXPORT_METHOD methods to plain ObjC declarations with zero FLAG lines (no type mismatches, so no RCTConvert reconciliation required). 4. Left RCT_EXPORT_MODULE() untouched. 5. Ran buck_build_verify (BUILD SUCCEEDED) and Lint (no lints found). _____ * Do **NOT** post in the CodemodService Feedback group about this specific diff. * If you have feedback, comment on the diff and use an appropriate diff action. This [diff was created](https://www.internalfb.com/intern/sandcastle/job/31525200232184606/) with [CodemodService](https://www.internalfb.com/codemod_service/CodemodConfigDevmateDropRctExportMethod). Reviewed By: cortinico, christophpurrer Differential Revision: D115003202 fbshipit-source-id: 964528bdbad4a82c21096d4d8ca16588fe17514b
This commit is contained in:
1 parent
4bf9d4e9b0
commit
6d34b7aaff
1 file changed
+8
-8
@@ -95,20 +95,20 @@ RCT_EXPORT_MODULE()
|
||||
});
|
||||
}
|
||||
|
||||
RCT_EXPORT_METHOD(removeImageForTag : (NSString *)imageTag)
|
||||
- (void)removeImageForTag:(NSString *)imageTag
|
||||
{
|
||||
[_store removeObjectForKey:imageTag];
|
||||
}
|
||||
|
||||
RCT_EXPORT_METHOD(hasImageForTag : (NSString *)imageTag callback : (RCTResponseSenderBlock)callback)
|
||||
- (void)hasImageForTag:(NSString *)imageTag callback:(RCTResponseSenderBlock)callback
|
||||
{
|
||||
callback(@[ @(_store[imageTag] != nil) ]);
|
||||
}
|
||||
|
||||
// TODO (#5906496): Name could be more explicit - something like getBase64EncodedDataForTag:?
|
||||
RCT_EXPORT_METHOD(
|
||||
getBase64ForTag : (NSString *)imageTag successCallback : (RCTResponseSenderBlock)
|
||||
successCallback errorCallback : (RCTResponseSenderBlock)errorCallback)
|
||||
- (void)getBase64ForTag:(NSString *)imageTag
|
||||
successCallback:(RCTResponseSenderBlock)successCallback
|
||||
errorCallback:(RCTResponseSenderBlock)errorCallback
|
||||
{
|
||||
NSData *imageData = _store[imageTag];
|
||||
if (imageData == nullptr) {
|
||||
@@ -122,9 +122,9 @@ RCT_EXPORT_METHOD(
|
||||
});
|
||||
}
|
||||
|
||||
RCT_EXPORT_METHOD(
|
||||
addImageFromBase64 : (NSString *)base64String successCallback : (RCTResponseSenderBlock)
|
||||
successCallback errorCallback : (RCTResponseSenderBlock)errorCallback)
|
||||
- (void)addImageFromBase64:(NSString *)base64String
|
||||
successCallback:(RCTResponseSenderBlock)successCallback
|
||||
errorCallback:(RCTResponseSenderBlock)errorCallback
|
||||
|
||||
{
|
||||
// Dispatching to a background thread to perform base64 decoding
|
||||
|
||||
Reference in new issue
Block a user