2015-03-23 15:07:33 -07:00
|
|
|
/**
|
|
|
|
* Copyright (c) 2015-present, Facebook, Inc.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* This source code is licensed under the BSD-style license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
|
|
*/
|
2015-01-29 17:10:49 -08:00
|
|
|
|
|
|
|
#import <UIKit/UIKit.h>
|
|
|
|
|
2015-07-27 13:46:59 -07:00
|
|
|
#import "RCTBridge.h"
|
|
|
|
#import "RCTImageLoader.h"
|
2015-07-09 15:48:22 -01:00
|
|
|
|
2015-07-27 13:46:59 -07:00
|
|
|
@interface RCTImageDownloader : NSObject <RCTBridgeModule>
|
2015-02-03 16:15:20 -08:00
|
|
|
|
2015-03-30 20:12:32 -07:00
|
|
|
/**
|
|
|
|
* Downloads an image and decompresses it a the size specified. The compressed
|
|
|
|
* image will be cached in memory and to disk. Note that the callback block
|
|
|
|
* will not be executed on the same thread you called the method from, nor on
|
|
|
|
* the main thread. Returns a token that can be used to cancel the download.
|
|
|
|
*/
|
2015-07-27 13:46:59 -07:00
|
|
|
- (RCTImageLoaderCancellationBlock)downloadImageForURL:(NSURL *)url
|
|
|
|
size:(CGSize)size
|
|
|
|
scale:(CGFloat)scale
|
|
|
|
resizeMode:(UIViewContentMode)resizeMode
|
|
|
|
progressBlock:(RCTImageLoaderProgressBlock)progressBlock
|
|
|
|
completionBlock:(RCTImageLoaderCompletionBlock)block;
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
@interface RCTBridge (RCTImageDownloader)
|
|
|
|
|
|
|
|
@property (nonatomic, readonly) RCTImageDownloader *imageDownloader;
|
2015-01-29 17:10:49 -08:00
|
|
|
|
|
|
|
@end
|