mirror of
https://github.com/Tencent/Hippy.git
synced 2026-10-22 16:58:30 +08:00
40 lines
1.3 KiB
Objective-C
Executable File
40 lines
1.3 KiB
Objective-C
Executable File
/**
|
|
* 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.
|
|
*/
|
|
|
|
#import <UIKit/UIKit.h>
|
|
|
|
extern NSString *const HippyJavaScriptLoaderErrorDomain;
|
|
|
|
NS_ENUM(NSInteger) {
|
|
HippyJavaScriptLoaderErrorNoScriptURL = 1,
|
|
HippyJavaScriptLoaderErrorFailedOpeningFile = 2,
|
|
HippyJavaScriptLoaderErrorFailedReadingFile = 3,
|
|
HippyJavaScriptLoaderErrorFailedStatingFile = 3,
|
|
HippyJavaScriptLoaderErrorURLLoadFailed = 3,
|
|
|
|
HippyJavaScriptLoaderErrorCannotBeLoadedSynchronously = 1000,
|
|
};
|
|
|
|
@interface HippyLoadingProgress : NSObject
|
|
|
|
@property (nonatomic, copy) NSString *status;
|
|
@property (strong, nonatomic) NSNumber *done;
|
|
@property (strong, nonatomic) NSNumber *total;
|
|
|
|
@end
|
|
|
|
typedef void (^HippySourceLoadProgressBlock)(HippyLoadingProgress *progressData);
|
|
typedef void (^HippySourceLoadBlock)(NSError *error, NSData *source, int64_t sourceLength);
|
|
|
|
@interface HippyJavaScriptLoader : NSObject
|
|
|
|
+ (void)loadBundleAtURL:(NSURL *)scriptURL onProgress:(HippySourceLoadProgressBlock)onProgress onComplete:(HippySourceLoadBlock)onComplete;
|
|
|
|
@end
|