mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-01 22:41:28 +08:00
encapsulate JS source in RCTSource object
Reviewed By: alexeylang Differential Revision: D5669734 fbshipit-source-id: 60c798afa2115510a17acf9e970e8ba52507724f
This commit is contained in:
committed by
Facebook Github Bot
parent
b7096c1136
commit
abe7a2a9f1
@@ -33,8 +33,32 @@ NS_ENUM(NSInteger) {
|
||||
|
||||
@end
|
||||
|
||||
@interface RCTSource : NSObject
|
||||
|
||||
/**
|
||||
* URL of the source object.
|
||||
*/
|
||||
@property (strong, nonatomic, readonly) NSURL *url;
|
||||
|
||||
/**
|
||||
* JS source (or simply the binary header in the case of a RAM bundle).
|
||||
*/
|
||||
@property (strong, nonatomic, readonly) NSData *data;
|
||||
|
||||
/**
|
||||
* Length of the entire JS bundle. Note that self.length != self.data.length in the case of certain bundle formats. For
|
||||
* instance, when using RAM bundles:
|
||||
*
|
||||
* - self.data will point to the bundle header
|
||||
* - self.data.length is the length of the bundle header, i.e. sizeof(facebook::react::BundleHeader)
|
||||
* - self.length is the length of the entire bundle file (header + contents)
|
||||
*/
|
||||
@property (nonatomic, readonly) NSUInteger length;
|
||||
|
||||
@end
|
||||
|
||||
typedef void (^RCTSourceLoadProgressBlock)(RCTLoadingProgress *progressData);
|
||||
typedef void (^RCTSourceLoadBlock)(NSError *error, NSData *source, int64_t sourceLength);
|
||||
typedef void (^RCTSourceLoadBlock)(NSError *error, RCTSource *source);
|
||||
|
||||
@interface RCTJavaScriptLoader : NSObject
|
||||
|
||||
|
||||
Reference in New Issue
Block a user