2019-10-16 20:03:47 +03:00
|
|
|
/*
|
2018-09-12 01:27:47 +03:00
|
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
2015-12-08 14:29:08 +03:00
|
|
|
*
|
2018-02-17 05:24:55 +03:00
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree.
|
2015-12-08 14:29:08 +03:00
|
|
|
*/
|
|
|
|
|
|
|
|
#import <Foundation/Foundation.h>
|
|
|
|
|
2016-11-23 18:47:52 +03:00
|
|
|
#import <React/RCTConvert.h>
|
2015-12-08 14:29:08 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Object containing an image URL and associated metadata.
|
|
|
|
*/
|
|
|
|
@interface RCTImageSource : NSObject
|
|
|
|
|
2016-06-01 20:32:20 +03:00
|
|
|
@property (nonatomic, copy, readonly) NSURLRequest *request;
|
2015-12-08 14:29:08 +03:00
|
|
|
@property (nonatomic, assign, readonly) CGSize size;
|
|
|
|
@property (nonatomic, assign, readonly) CGFloat scale;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Create a new image source object.
|
|
|
|
* Pass a size of CGSizeZero if you do not know or wish to specify the image
|
|
|
|
* size. Pass a scale of zero if you do not know or wish to specify the scale.
|
|
|
|
*/
|
2020-03-09 08:58:01 +03:00
|
|
|
- (instancetype)initWithURLRequest:(NSURLRequest *)request size:(CGSize)size scale:(CGFloat)scale;
|
2015-12-08 14:29:08 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Create a copy of the image source with the specified size and scale.
|
|
|
|
*/
|
|
|
|
- (instancetype)imageSourceWithSize:(CGSize)size scale:(CGFloat)scale;
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
@interface RCTConvert (ImageSource)
|
|
|
|
|
|
|
|
+ (RCTImageSource *)RCTImageSource:(id)json;
|
2016-07-28 23:58:50 +03:00
|
|
|
+ (NSArray<RCTImageSource *> *)RCTImageSourceArray:(id)json;
|
2015-12-08 14:29:08 +03:00
|
|
|
|
|
|
|
@end
|