mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
d8fda74c24
Summary: In D16805827, I moved `RCTImageLoader`, `RCTImageStoreManager`, and `RCTImageEditingManager` to `CoreModules`. This was necessary to turn `RCTImageLoader` into a TurboModule. However, after D17671288 landed, it's no longer necessary to have OSS NativeModules in `CoreModules`. Therefore, I'm moving these NativeModules back to `RCTImage`. Changelog: [iOS][Fixed] Move RCTImage NativeModules back to RCTImage Reviewed By: shergin Differential Revision: D17921612 fbshipit-source-id: 8ae36d2dc8deaf704313cbe2479bfa011ebcbfbc
47 lines
1.5 KiB
Objective-C
47 lines
1.5 KiB
Objective-C
/*
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* 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 <React/RCTBridge.h>
|
|
#import <React/RCTURLRequestHandler.h>
|
|
|
|
@interface RCTImageStoreManager : NSObject <RCTURLRequestHandler>
|
|
|
|
/**
|
|
* Set and get cached image data asynchronously. It is safe to call these from any
|
|
* thread. The callbacks will be called on an unspecified thread.
|
|
*/
|
|
- (void)removeImageForTag:(NSString *)imageTag withBlock:(void (^)(void))block;
|
|
- (void)storeImageData:(NSData *)imageData withBlock:(void (^)(NSString *imageTag))block;
|
|
- (void)getImageDataForTag:(NSString *)imageTag withBlock:(void (^)(NSData *imageData))block;
|
|
|
|
/**
|
|
* Convenience method to store an image directly (image is converted to data
|
|
* internally, so any metadata such as scale or orientation will be lost).
|
|
*/
|
|
- (void)storeImage:(UIImage *)image withBlock:(void (^)(NSString *imageTag))block;
|
|
|
|
@end
|
|
|
|
@interface RCTImageStoreManager (Deprecated)
|
|
|
|
/**
|
|
* These methods are deprecated - use the data-based alternatives instead.
|
|
*/
|
|
- (NSString *)storeImage:(UIImage *)image __deprecated;
|
|
- (UIImage *)imageForTag:(NSString *)imageTag __deprecated;
|
|
- (void)getImageForTag:(NSString *)imageTag withBlock:(void (^)(UIImage *image))block __deprecated;
|
|
|
|
@end
|
|
|
|
@interface RCTBridge (RCTImageStoreManager)
|
|
|
|
@property (nonatomic, readonly) RCTImageStoreManager *imageStoreManager;
|
|
|
|
@end
|