@octane-xplat/nativescript-mason-core 0.0.1 → 1.0.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (187) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +113 -2
  3. package/artifact-inventory.json +746 -0
  4. package/box-shadow.d.ts +10 -0
  5. package/box-shadow.js +48 -0
  6. package/common.d.ts +482 -0
  7. package/common.js +2645 -0
  8. package/css-colors.d.ts +17 -0
  9. package/css-colors.js +54 -0
  10. package/css-filter.d.ts +17 -0
  11. package/css-filter.js +140 -0
  12. package/css-keyframes.d.ts +41 -0
  13. package/css-keyframes.js +437 -0
  14. package/css-math.d.ts +34 -0
  15. package/css-math.js +300 -0
  16. package/css-shorthands.d.ts +65 -0
  17. package/css-shorthands.js +673 -0
  18. package/css-transform.d.ts +6 -0
  19. package/css-transform.js +100 -0
  20. package/diagnostics.d.ts +51 -0
  21. package/diagnostics.js +52 -0
  22. package/display-density.d.ts +9 -0
  23. package/display-density.js +20 -0
  24. package/fonts.d.ts +20 -0
  25. package/fonts.js +88 -0
  26. package/foreign-layout.d.ts +6 -0
  27. package/foreign-layout.js +149 -0
  28. package/gradient-stops.d.ts +25 -0
  29. package/gradient-stops.js +112 -0
  30. package/index.android.d.ts +9 -0
  31. package/index.android.js +8 -0
  32. package/index.d.ts +10 -0
  33. package/index.ios.d.ts +9 -0
  34. package/index.ios.js +8 -0
  35. package/ios-host-README.md +124 -0
  36. package/layout-types.d.ts +192 -0
  37. package/mask.d.ts +54 -0
  38. package/mask.js +26 -0
  39. package/native-types-README.md +51 -0
  40. package/package.json +44 -6
  41. package/panel-helpers.d.ts +3 -0
  42. package/panel-helpers.js +8 -0
  43. package/platforms/android/MasonCore.aar +0 -0
  44. package/platforms/android/include.gradle +6 -0
  45. package/platforms/android/manifest.json +73 -0
  46. package/platforms/ios/FontManager.LICENSE +201 -0
  47. package/platforms/ios/MasonCore.xcframework/Info.plist +43 -0
  48. package/platforms/ios/MasonCore.xcframework/ios-arm64/MasonCore.framework/Headers/Mason.h +25 -0
  49. package/platforms/ios/MasonCore.xcframework/ios-arm64/MasonCore.framework/Headers/MasonCore-Swift.h +1739 -0
  50. package/platforms/ios/MasonCore.xcframework/ios-arm64/MasonCore.framework/Headers/mason_native.h +601 -0
  51. package/platforms/ios/MasonCore.xcframework/ios-arm64/MasonCore.framework/Info.plist +0 -0
  52. package/platforms/ios/MasonCore.xcframework/ios-arm64/MasonCore.framework/MasonCore +0 -0
  53. package/platforms/ios/MasonCore.xcframework/ios-arm64/MasonCore.framework/Modules/MasonCore.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo +0 -0
  54. package/platforms/ios/MasonCore.xcframework/ios-arm64/MasonCore.framework/Modules/MasonCore.swiftmodule/arm64-apple-ios.abi.json +100095 -0
  55. package/platforms/ios/MasonCore.xcframework/ios-arm64/MasonCore.framework/Modules/MasonCore.swiftmodule/arm64-apple-ios.private.swiftinterface +3174 -0
  56. package/platforms/ios/MasonCore.xcframework/ios-arm64/MasonCore.framework/Modules/MasonCore.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  57. package/platforms/ios/MasonCore.xcframework/ios-arm64/MasonCore.framework/Modules/MasonCore.swiftmodule/arm64-apple-ios.swiftinterface +3174 -0
  58. package/platforms/ios/MasonCore.xcframework/ios-arm64/MasonCore.framework/Modules/module.modulemap +9 -0
  59. package/platforms/ios/MasonCore.xcframework/ios-arm64/MasonCore.framework/SDWebImage_SDWebImage.bundle/Info.plist +0 -0
  60. package/platforms/ios/MasonCore.xcframework/ios-arm64/MasonCore.framework/SDWebImage_SDWebImage.bundle/PrivacyInfo.xcprivacy +23 -0
  61. package/platforms/ios/MasonCore.xcframework/ios-arm64-simulator/MasonCore.framework/Headers/Mason.h +25 -0
  62. package/platforms/ios/MasonCore.xcframework/ios-arm64-simulator/MasonCore.framework/Headers/MasonCore-Swift.h +1739 -0
  63. package/platforms/ios/MasonCore.xcframework/ios-arm64-simulator/MasonCore.framework/Headers/mason_native.h +601 -0
  64. package/platforms/ios/MasonCore.xcframework/ios-arm64-simulator/MasonCore.framework/Info.plist +0 -0
  65. package/platforms/ios/MasonCore.xcframework/ios-arm64-simulator/MasonCore.framework/MasonCore +0 -0
  66. package/platforms/ios/MasonCore.xcframework/ios-arm64-simulator/MasonCore.framework/Modules/MasonCore.swiftmodule/Project/arm64-apple-ios-simulator.swiftsourceinfo +0 -0
  67. package/platforms/ios/MasonCore.xcframework/ios-arm64-simulator/MasonCore.framework/Modules/MasonCore.swiftmodule/arm64-apple-ios-simulator.abi.json +100095 -0
  68. package/platforms/ios/MasonCore.xcframework/ios-arm64-simulator/MasonCore.framework/Modules/MasonCore.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +3174 -0
  69. package/platforms/ios/MasonCore.xcframework/ios-arm64-simulator/MasonCore.framework/Modules/MasonCore.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
  70. package/platforms/ios/MasonCore.xcframework/ios-arm64-simulator/MasonCore.framework/Modules/MasonCore.swiftmodule/arm64-apple-ios-simulator.swiftinterface +3174 -0
  71. package/platforms/ios/MasonCore.xcframework/ios-arm64-simulator/MasonCore.framework/Modules/module.modulemap +9 -0
  72. package/platforms/ios/MasonCore.xcframework/ios-arm64-simulator/MasonCore.framework/SDWebImage_SDWebImage.bundle/Info.plist +0 -0
  73. package/platforms/ios/MasonCore.xcframework/ios-arm64-simulator/MasonCore.framework/SDWebImage_SDWebImage.bundle/PrivacyInfo.xcprivacy +23 -0
  74. package/platforms/ios/Package.resolved +24 -0
  75. package/platforms/ios/SDWebImage.LICENSE +20 -0
  76. package/platforms/ios/build.xcconfig +4 -0
  77. package/platforms/ios/device-manifest.json +213 -0
  78. package/platforms/ios/include/FontManager/NSCFontDescriptors.h +36 -0
  79. package/platforms/ios/include/FontManager/NSCFontFace.h +98 -0
  80. package/platforms/ios/include/FontManager/NSCFontFaceSet.h +73 -0
  81. package/platforms/ios/include/FontManager/NSCFontManagerUmbrella.h +7 -0
  82. package/platforms/ios/include/FontManager/NSCFontParser.h +22 -0
  83. package/platforms/ios/include/FontManager/NSCFontRegex.h +4 -0
  84. package/platforms/ios/include/FontManager/NSCFontResolver.h +43 -0
  85. package/platforms/ios/include/FontManager/NSCFontStyle.h +27 -0
  86. package/platforms/ios/include/FontManager/NSCFontTypes.h +41 -0
  87. package/platforms/ios/include/SDWebImage/NSButton+WebCache.h +340 -0
  88. package/platforms/ios/include/SDWebImage/NSData+ImageContentType.h +63 -0
  89. package/platforms/ios/include/SDWebImage/NSImage+Compatibility.h +67 -0
  90. package/platforms/ios/include/SDWebImage/SDAnimatedImage.h +136 -0
  91. package/platforms/ios/include/SDWebImage/SDAnimatedImagePlayer.h +113 -0
  92. package/platforms/ios/include/SDWebImage/SDAnimatedImageRep.h +33 -0
  93. package/platforms/ios/include/SDWebImage/SDAnimatedImageView+WebCache.h +168 -0
  94. package/platforms/ios/include/SDWebImage/SDAnimatedImageView.h +125 -0
  95. package/platforms/ios/include/SDWebImage/SDCallbackQueue.h +59 -0
  96. package/platforms/ios/include/SDWebImage/SDDiskCache.h +146 -0
  97. package/platforms/ios/include/SDWebImage/SDGraphicsImageRenderer.h +84 -0
  98. package/platforms/ios/include/SDWebImage/SDImageAPNGCoder.h +19 -0
  99. package/platforms/ios/include/SDWebImage/SDImageAWebPCoder.h +23 -0
  100. package/platforms/ios/include/SDWebImage/SDImageCache.h +482 -0
  101. package/platforms/ios/include/SDWebImage/SDImageCacheConfig.h +153 -0
  102. package/platforms/ios/include/SDWebImage/SDImageCacheDefine.h +179 -0
  103. package/platforms/ios/include/SDWebImage/SDImageCachesManager.h +81 -0
  104. package/platforms/ios/include/SDWebImage/SDImageCoder.h +347 -0
  105. package/platforms/ios/include/SDWebImage/SDImageCoderHelper.h +251 -0
  106. package/platforms/ios/include/SDWebImage/SDImageCodersManager.h +58 -0
  107. package/platforms/ios/include/SDWebImage/SDImageFrame.h +44 -0
  108. package/platforms/ios/include/SDWebImage/SDImageGIFCoder.h +22 -0
  109. package/platforms/ios/include/SDWebImage/SDImageGraphics.h +28 -0
  110. package/platforms/ios/include/SDWebImage/SDImageHEICCoder.h +25 -0
  111. package/platforms/ios/include/SDWebImage/SDImageIOAnimatedCoder.h +65 -0
  112. package/platforms/ios/include/SDWebImage/SDImageIOCoder.h +30 -0
  113. package/platforms/ios/include/SDWebImage/SDImageLoader.h +146 -0
  114. package/platforms/ios/include/SDWebImage/SDImageLoadersManager.h +40 -0
  115. package/platforms/ios/include/SDWebImage/SDImageTransformer.h +283 -0
  116. package/platforms/ios/include/SDWebImage/SDMemoryCache.h +78 -0
  117. package/platforms/ios/include/SDWebImage/SDWebImage.h +91 -0
  118. package/platforms/ios/include/SDWebImage/SDWebImageCacheKeyFilter.h +35 -0
  119. package/platforms/ios/include/SDWebImage/SDWebImageCacheSerializer.h +39 -0
  120. package/platforms/ios/include/SDWebImage/SDWebImageCompat.h +102 -0
  121. package/platforms/ios/include/SDWebImage/SDWebImageDefine.h +420 -0
  122. package/platforms/ios/include/SDWebImage/SDWebImageDownloader.h +320 -0
  123. package/platforms/ios/include/SDWebImage/SDWebImageDownloaderConfig.h +113 -0
  124. package/platforms/ios/include/SDWebImage/SDWebImageDownloaderDecryptor.h +52 -0
  125. package/platforms/ios/include/SDWebImage/SDWebImageDownloaderOperation.h +191 -0
  126. package/platforms/ios/include/SDWebImage/SDWebImageDownloaderRequestModifier.h +72 -0
  127. package/platforms/ios/include/SDWebImage/SDWebImageDownloaderResponseModifier.h +72 -0
  128. package/platforms/ios/include/SDWebImage/SDWebImageError.h +33 -0
  129. package/platforms/ios/include/SDWebImage/SDWebImageIndicator.h +119 -0
  130. package/platforms/ios/include/SDWebImage/SDWebImageManager.h +290 -0
  131. package/platforms/ios/include/SDWebImage/SDWebImageOperation.h +27 -0
  132. package/platforms/ios/include/SDWebImage/SDWebImageOptionsProcessor.h +78 -0
  133. package/platforms/ios/include/SDWebImage/SDWebImagePrefetcher.h +168 -0
  134. package/platforms/ios/include/SDWebImage/SDWebImageTransition.h +131 -0
  135. package/platforms/ios/include/SDWebImage/UIButton+WebCache.h +402 -0
  136. package/platforms/ios/include/SDWebImage/UIImage+ExtendedCacheData.h +24 -0
  137. package/platforms/ios/include/SDWebImage/UIImage+ForceDecode.h +52 -0
  138. package/platforms/ios/include/SDWebImage/UIImage+GIF.h +26 -0
  139. package/platforms/ios/include/SDWebImage/UIImage+MemoryCacheCost.h +27 -0
  140. package/platforms/ios/include/SDWebImage/UIImage+Metadata.h +104 -0
  141. package/platforms/ios/include/SDWebImage/UIImage+MultiFormat.h +81 -0
  142. package/platforms/ios/include/SDWebImage/UIImage+Transform.h +164 -0
  143. package/platforms/ios/include/SDWebImage/UIImageView+HighlightedWebCache.h +142 -0
  144. package/platforms/ios/include/SDWebImage/UIImageView+WebCache.h +209 -0
  145. package/platforms/ios/include/SDWebImage/UIView+WebCache.h +131 -0
  146. package/platforms/ios/include/SDWebImage/UIView+WebCacheOperation.h +52 -0
  147. package/platforms/ios/include/SDWebImage/UIView+WebCacheState.h +63 -0
  148. package/platforms/ios/include/module.modulemap +2 -0
  149. package/platforms/ios/manifest.json +132 -0
  150. package/platforms/ios/simulator-manifest.json +213 -0
  151. package/plugin-README.md +197 -0
  152. package/properties.d.ts +154 -0
  153. package/properties.js +2454 -0
  154. package/pseudo.d.ts +9 -0
  155. package/pseudo.js +57 -0
  156. package/scroll/index.android.d.ts +15 -0
  157. package/scroll/index.android.js +72 -0
  158. package/scroll/index.d.ts +5 -0
  159. package/scroll/index.ios.d.ts +18 -0
  160. package/scroll/index.ios.js +106 -0
  161. package/style.d.ts +768 -0
  162. package/style.js +7151 -0
  163. package/symbols.d.ts +25 -0
  164. package/symbols.js +41 -0
  165. package/tree/index.android.d.ts +11 -0
  166. package/tree/index.android.js +42 -0
  167. package/tree/index.d.ts +15 -0
  168. package/tree/index.ios.d.ts +26 -0
  169. package/tree/index.ios.js +53 -0
  170. package/typings/android-declarations.d.ts +4 -0
  171. package/typings/android.d.ts +9730 -0
  172. package/typings/manifest.json +45 -0
  173. package/typings/native.d.ts +5 -0
  174. package/typings/objc!FontManager.d.ts +389 -0
  175. package/typings/objc!MasonCore.d.ts +2472 -0
  176. package/typings/objc!SDWebImage.d.ts +3378 -0
  177. package/units.d.ts +29 -0
  178. package/units.js +44 -0
  179. package/utils/index.android.d.ts +211 -0
  180. package/utils/index.android.js +595 -0
  181. package/utils/index.ios.d.ts +222 -0
  182. package/utils/index.ios.js +790 -0
  183. package/view/index.android.d.ts +13 -0
  184. package/view/index.android.js +74 -0
  185. package/view/index.d.ts +2 -0
  186. package/view/index.ios.d.ts +24 -0
  187. package/view/index.ios.js +157 -0
@@ -0,0 +1,78 @@
1
+ /*
2
+ * This file is part of the SDWebImage package.
3
+ * (c) Olivier Poitrey <rs@dailymotion.com>
4
+ *
5
+ * For the full copyright and license information, please view the LICENSE
6
+ * file that was distributed with this source code.
7
+ */
8
+
9
+ #import <Foundation/Foundation.h>
10
+ #import "SDWebImageCompat.h"
11
+ #import "SDWebImageDefine.h"
12
+
13
+ @class SDWebImageOptionsResult;
14
+
15
+ typedef SDWebImageOptionsResult * _Nullable(^SDWebImageOptionsProcessorBlock)(NSURL * _Nullable url, SDWebImageOptions options, SDWebImageContext * _Nullable context);
16
+
17
+ /**
18
+ The options result contains both options and context.
19
+ */
20
+ @interface SDWebImageOptionsResult : NSObject
21
+
22
+ /**
23
+ WebCache options.
24
+ */
25
+ @property (nonatomic, assign, readonly) SDWebImageOptions options;
26
+
27
+ /**
28
+ Context options.
29
+ */
30
+ @property (nonatomic, copy, readonly, nullable) SDWebImageContext *context;
31
+
32
+ /**
33
+ Create a new options result.
34
+
35
+ @param options options
36
+ @param context context
37
+ @return The options result contains both options and context.
38
+ */
39
+ - (nonnull instancetype)initWithOptions:(SDWebImageOptions)options context:(nullable SDWebImageContext *)context;
40
+
41
+ - (nonnull instancetype)init NS_UNAVAILABLE;
42
+ + (nonnull instancetype)new NS_UNAVAILABLE;
43
+
44
+ @end
45
+
46
+ /**
47
+ This is the protocol for options processor.
48
+ Options processor can be used, to control the final result for individual image request's `SDWebImageOptions` and `SDWebImageContext`
49
+ Implements the protocol to have a global control for each indivadual image request's option.
50
+ */
51
+ @protocol SDWebImageOptionsProcessor <NSObject>
52
+
53
+ /**
54
+ Return the processed options result for specify image URL, with its options and context
55
+
56
+ @param url The URL to the image
57
+ @param options A mask to specify options to use for this request
58
+ @param context A context contains different options to perform specify changes or processes, see `SDWebImageContextOption`. This hold the extra objects which `options` enum can not hold.
59
+ @return The processed result, contains both options and context
60
+ */
61
+ - (nullable SDWebImageOptionsResult *)processedResultForURL:(nullable NSURL *)url
62
+ options:(SDWebImageOptions)options
63
+ context:(nullable SDWebImageContext *)context;
64
+
65
+ @end
66
+
67
+ /**
68
+ A options processor class with block.
69
+ */
70
+ @interface SDWebImageOptionsProcessor : NSObject<SDWebImageOptionsProcessor>
71
+
72
+ - (nonnull instancetype)initWithBlock:(nonnull SDWebImageOptionsProcessorBlock)block;
73
+ + (nonnull instancetype)optionsProcessorWithBlock:(nonnull SDWebImageOptionsProcessorBlock)block;
74
+
75
+ - (nonnull instancetype)init NS_UNAVAILABLE;
76
+ + (nonnull instancetype)new NS_UNAVAILABLE;
77
+
78
+ @end
@@ -0,0 +1,168 @@
1
+ /*
2
+ * This file is part of the SDWebImage package.
3
+ * (c) Olivier Poitrey <rs@dailymotion.com>
4
+ *
5
+ * For the full copyright and license information, please view the LICENSE
6
+ * file that was distributed with this source code.
7
+ */
8
+
9
+ #import <Foundation/Foundation.h>
10
+ #import "SDWebImageManager.h"
11
+
12
+ @class SDWebImagePrefetcher;
13
+
14
+ /**
15
+ A token represents a list of URLs, can be used to cancel the download.
16
+ */
17
+ @interface SDWebImagePrefetchToken : NSObject <SDWebImageOperation>
18
+
19
+ /**
20
+ * Cancel the current prefetching.
21
+ */
22
+ - (void)cancel;
23
+
24
+ /**
25
+ list of URLs of current prefetching.
26
+ */
27
+ @property (nonatomic, copy, readonly, nullable) NSArray<NSURL *> *urls;
28
+
29
+ @end
30
+
31
+ /**
32
+ The prefetcher delegate protocol
33
+ */
34
+ @protocol SDWebImagePrefetcherDelegate <NSObject>
35
+
36
+ @optional
37
+
38
+ /**
39
+ * Called when an image was prefetched. Which means it's called when one URL from any of prefetching finished.
40
+ *
41
+ * @param imagePrefetcher The current image prefetcher
42
+ * @param imageURL The image url that was prefetched
43
+ * @param finishedCount The total number of images that were prefetched (successful or not)
44
+ * @param totalCount The total number of images that were to be prefetched
45
+ */
46
+ - (void)imagePrefetcher:(nonnull SDWebImagePrefetcher *)imagePrefetcher didPrefetchURL:(nullable NSURL *)imageURL finishedCount:(NSUInteger)finishedCount totalCount:(NSUInteger)totalCount;
47
+
48
+ /**
49
+ * Called when all images are prefetched. Which means it's called when all URLs from all of prefetching finished.
50
+ * @param imagePrefetcher The current image prefetcher
51
+ * @param totalCount The total number of images that were prefetched (whether successful or not)
52
+ * @param skippedCount The total number of images that were skipped
53
+ */
54
+ - (void)imagePrefetcher:(nonnull SDWebImagePrefetcher *)imagePrefetcher didFinishWithTotalCount:(NSUInteger)totalCount skippedCount:(NSUInteger)skippedCount;
55
+
56
+ @end
57
+
58
+ typedef void(^SDWebImagePrefetcherProgressBlock)(NSUInteger noOfFinishedUrls, NSUInteger noOfTotalUrls);
59
+ typedef void(^SDWebImagePrefetcherCompletionBlock)(NSUInteger noOfFinishedUrls, NSUInteger noOfSkippedUrls);
60
+
61
+ /**
62
+ * Prefetch some URLs in the cache for future use. Images are downloaded in low priority.
63
+ */
64
+ @interface SDWebImagePrefetcher : NSObject
65
+
66
+ /**
67
+ * The web image manager used by prefetcher to prefetch images.
68
+ * @note You can specify a standalone manager and downloader with custom configuration suitable for image prefetching. Such as `currentDownloadCount` or `downloadTimeout`.
69
+ */
70
+ @property (strong, nonatomic, readonly, nonnull) SDWebImageManager *manager;
71
+
72
+ /**
73
+ * Maximum number of URLs to prefetch at the same time. Defaults to 3.
74
+ */
75
+ @property (nonatomic, assign) NSUInteger maxConcurrentPrefetchCount;
76
+
77
+ /**
78
+ * The options for prefetcher. Defaults to SDWebImageLowPriority.
79
+ * @deprecated Prefetcher is designed to be used shared and should not effect others. So in 5.15.0 we added API `prefetchURLs:options:context:`. If you want global control, try to use `SDWebImageOptionsProcessor` in manager level.
80
+ */
81
+ @property (nonatomic, assign) SDWebImageOptions options API_DEPRECATED("Use individual prefetch options param instead", macos(10.10, API_TO_BE_DEPRECATED), ios(8.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED));
82
+
83
+ /**
84
+ * The context for prefetcher. Defaults to nil.
85
+ * @deprecated Prefetcher is designed to be used shared and should not effect others. So in 5.15.0 we added API `prefetchURLs:options:context:`. If you want global control, try to use `SDWebImageOptionsProcessor` in `SDWebImageManager.optionsProcessor`.
86
+ */
87
+ @property (nonatomic, copy, nullable) SDWebImageContext *context API_DEPRECATED("Use individual prefetch context param instead", macos(10.10, API_TO_BE_DEPRECATED), ios(8.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED));
88
+
89
+ /**
90
+ * Queue options for prefetcher when call the progressBlock, completionBlock and delegate methods. Defaults to Main Queue.
91
+ * @deprecated 5.15.0 introduce SDCallbackQueue, use that is preferred and has higher priority. The set/get to this property will translate to that instead.
92
+ * @note The call is asynchronously to avoid blocking target queue. (see SDCallbackPolicyDispatch)
93
+ * @note The delegate queue should be set before any prefetching start and may not be changed during prefetching to avoid thread-safe problem.
94
+ */
95
+ @property (strong, nonatomic, nonnull) dispatch_queue_t delegateQueue API_DEPRECATED("Use SDWebImageContextCallbackQueue context param instead, see SDCallbackQueue", macos(10.10, 10.10), ios(8.0, 8.0), tvos(9.0, 9.0), watchos(2.0, 2.0));
96
+
97
+ /**
98
+ * The delegate for the prefetcher. Defaults to nil.
99
+ */
100
+ @property (weak, nonatomic, nullable) id <SDWebImagePrefetcherDelegate> delegate;
101
+
102
+ /**
103
+ * Returns the global shared image prefetcher instance. It use a standalone manager which is different from shared manager.
104
+ */
105
+ @property (nonatomic, class, readonly, nonnull) SDWebImagePrefetcher *sharedImagePrefetcher;
106
+
107
+ /**
108
+ * Allows you to instantiate a prefetcher with any arbitrary image manager.
109
+ */
110
+ - (nonnull instancetype)initWithImageManager:(nonnull SDWebImageManager *)manager NS_DESIGNATED_INITIALIZER;
111
+
112
+ /**
113
+ * Assign list of URLs to let SDWebImagePrefetcher to queue the prefetching. It based on the image manager so the image may from the cache and network according to the `options` property.
114
+ * Prefetching is separate to each other, which means the progressBlock and completionBlock you provide is bind to the prefetching for the list of urls.
115
+ * Attention that call this will not cancel previous fetched urls. You should keep the token return by this to cancel or cancel all the prefetch.
116
+ *
117
+ * @param urls list of URLs to prefetch
118
+ * @return the token to cancel the current prefetching.
119
+ */
120
+ - (nullable SDWebImagePrefetchToken *)prefetchURLs:(nullable NSArray<NSURL *> *)urls;
121
+
122
+ /**
123
+ * Assign list of URLs to let SDWebImagePrefetcher to queue the prefetching. It based on the image manager so the image may from the cache and network according to the `options` property.
124
+ * Prefetching is separate to each other, which means the progressBlock and completionBlock you provide is bind to the prefetching for the list of urls.
125
+ * Attention that call this will not cancel previous fetched urls. You should keep the token return by this to cancel or cancel all the prefetch.
126
+ *
127
+ * @param urls list of URLs to prefetch
128
+ * @param progressBlock block to be called when progress updates;
129
+ * first parameter is the number of completed (successful or not) requests,
130
+ * second parameter is the total number of images originally requested to be prefetched
131
+ * @param completionBlock block to be called when the current prefetching is completed
132
+ * first param is the number of completed (successful or not) requests,
133
+ * second parameter is the number of skipped requests
134
+ * @return the token to cancel the current prefetching.
135
+ */
136
+ - (nullable SDWebImagePrefetchToken *)prefetchURLs:(nullable NSArray<NSURL *> *)urls
137
+ progress:(nullable SDWebImagePrefetcherProgressBlock)progressBlock
138
+ completed:(nullable SDWebImagePrefetcherCompletionBlock)completionBlock;
139
+
140
+ /**
141
+ * Assign list of URLs to let SDWebImagePrefetcher to queue the prefetching. It based on the image manager so the image may from the cache and network according to the `options` property.
142
+ * Prefetching is separate to each other, which means the progressBlock and completionBlock you provide is bind to the prefetching for the list of urls.
143
+ * Attention that call this will not cancel previous fetched urls. You should keep the token return by this to cancel or cancel all the prefetch.
144
+ *
145
+ * @param urls list of URLs to prefetch
146
+ * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values.
147
+ * @param context A context contains different options to perform specify changes or processes, see `SDWebImageContextOption`. This hold the extra objects which `options` enum can not hold.
148
+ * @param progressBlock block to be called when progress updates;
149
+ * first parameter is the number of completed (successful or not) requests,
150
+ * second parameter is the total number of images originally requested to be prefetched
151
+ * @param completionBlock block to be called when the current prefetching is completed
152
+ * first param is the number of completed (successful or not) requests,
153
+ * second parameter is the number of skipped requests
154
+ * @return the token to cancel the current prefetching.
155
+ */
156
+ - (nullable SDWebImagePrefetchToken *)prefetchURLs:(nullable NSArray<NSURL *> *)urls
157
+ options:(SDWebImageOptions)options
158
+ context:(nullable SDWebImageContext *)context
159
+ progress:(nullable SDWebImagePrefetcherProgressBlock)progressBlock
160
+ completed:(nullable SDWebImagePrefetcherCompletionBlock)completionBlock;
161
+
162
+ /**
163
+ * Remove and cancel all the prefeching for the prefetcher.
164
+ */
165
+ - (void)cancelPrefetching;
166
+
167
+
168
+ @end
@@ -0,0 +1,131 @@
1
+ /*
2
+ * This file is part of the SDWebImage package.
3
+ * (c) Olivier Poitrey <rs@dailymotion.com>
4
+ *
5
+ * For the full copyright and license information, please view the LICENSE
6
+ * file that was distributed with this source code.
7
+ */
8
+
9
+ #import "SDWebImageCompat.h"
10
+
11
+ #if SD_UIKIT || SD_MAC
12
+ #import "SDImageCache.h"
13
+
14
+ #if SD_UIKIT
15
+ typedef UIViewAnimationOptions SDWebImageAnimationOptions;
16
+ #else
17
+ typedef NS_OPTIONS(NSUInteger, SDWebImageAnimationOptions) {
18
+ SDWebImageAnimationOptionAllowsImplicitAnimation = 1 << 0, // specify `allowsImplicitAnimation` for the `NSAnimationContext`
19
+
20
+ SDWebImageAnimationOptionCurveEaseInOut = 0 << 16, // default
21
+ SDWebImageAnimationOptionCurveEaseIn = 1 << 16,
22
+ SDWebImageAnimationOptionCurveEaseOut = 2 << 16,
23
+ SDWebImageAnimationOptionCurveLinear = 3 << 16,
24
+
25
+ SDWebImageAnimationOptionTransitionNone = 0 << 20, // default
26
+ SDWebImageAnimationOptionTransitionFlipFromLeft = 1 << 20,
27
+ SDWebImageAnimationOptionTransitionFlipFromRight = 2 << 20,
28
+ SDWebImageAnimationOptionTransitionCurlUp = 3 << 20,
29
+ SDWebImageAnimationOptionTransitionCurlDown = 4 << 20,
30
+ SDWebImageAnimationOptionTransitionCrossDissolve = 5 << 20,
31
+ SDWebImageAnimationOptionTransitionFlipFromTop = 6 << 20,
32
+ SDWebImageAnimationOptionTransitionFlipFromBottom = 7 << 20,
33
+ };
34
+ #endif
35
+
36
+ typedef void (^SDWebImageTransitionPreparesBlock)(__kindof UIView * _Nonnull view, UIImage * _Nullable image, NSData * _Nullable imageData, SDImageCacheType cacheType, NSURL * _Nullable imageURL);
37
+ typedef void (^SDWebImageTransitionAnimationsBlock)(__kindof UIView * _Nonnull view, UIImage * _Nullable image);
38
+ typedef void (^SDWebImageTransitionCompletionBlock)(BOOL finished);
39
+
40
+ /**
41
+ This class is used to provide a transition animation after the view category load image finished. Use this on `sd_imageTransition` in UIView+WebCache.h
42
+ for UIKit(iOS & tvOS), we use `+[UIView transitionWithView:duration:options:animations:completion]` for transition animation.
43
+ for AppKit(macOS), we use `+[NSAnimationContext runAnimationGroup:completionHandler:]` for transition animation. You can call `+[NSAnimationContext currentContext]` to grab the context during animations block.
44
+ @note These transition are provided for basic usage. If you need complicated animation, consider to directly use Core Animation or use `SDWebImageAvoidAutoSetImage` and implement your own after image load finished.
45
+ */
46
+ @interface SDWebImageTransition : NSObject
47
+
48
+ /**
49
+ By default, we set the image to the view at the beginning of the animations. You can disable this and provide custom set image process
50
+ */
51
+ @property (nonatomic, assign) BOOL avoidAutoSetImage;
52
+ /**
53
+ The duration of the transition animation, measured in seconds. Defaults to 0.5.
54
+ */
55
+ @property (nonatomic, assign) NSTimeInterval duration;
56
+ /**
57
+ The timing function used for all animations within this transition animation (macOS).
58
+ */
59
+ @property (nonatomic, strong, nullable) CAMediaTimingFunction *timingFunction API_UNAVAILABLE(ios, tvos, watchos) API_DEPRECATED("Use SDWebImageAnimationOptions instead, or grab NSAnimationContext.currentContext and modify the timingFunction", macos(10.10, 10.10));
60
+ /**
61
+ A mask of options indicating how you want to perform the animations.
62
+ */
63
+ @property (nonatomic, assign) SDWebImageAnimationOptions animationOptions;
64
+ /**
65
+ A block object to be executed before the animation sequence starts.
66
+ */
67
+ @property (nonatomic, copy, nullable) SDWebImageTransitionPreparesBlock prepares;
68
+ /**
69
+ A block object that contains the changes you want to make to the specified view.
70
+ */
71
+ @property (nonatomic, copy, nullable) SDWebImageTransitionAnimationsBlock animations;
72
+ /**
73
+ A block object to be executed when the animation sequence ends.
74
+ */
75
+ @property (nonatomic, copy, nullable) SDWebImageTransitionCompletionBlock completion;
76
+
77
+ @end
78
+
79
+ /**
80
+ Convenience way to create transition. Remember to specify the duration if needed.
81
+ for UIKit, these transition just use the correspond `animationOptions`. By default we enable `UIViewAnimationOptionAllowUserInteraction` to allow user interaction during transition.
82
+ for AppKit, these transition use Core Animation in `animations`. So your view must be layer-backed. Set `wantsLayer = YES` before you apply it.
83
+ */
84
+ @interface SDWebImageTransition (Conveniences)
85
+
86
+ /// Fade-in transition.
87
+ @property (nonatomic, class, nonnull, readonly) SDWebImageTransition *fadeTransition;
88
+ /// Flip from left transition.
89
+ @property (nonatomic, class, nonnull, readonly) SDWebImageTransition *flipFromLeftTransition;
90
+ /// Flip from right transition.
91
+ @property (nonatomic, class, nonnull, readonly) SDWebImageTransition *flipFromRightTransition;
92
+ /// Flip from top transition.
93
+ @property (nonatomic, class, nonnull, readonly) SDWebImageTransition *flipFromTopTransition;
94
+ /// Flip from bottom transition.
95
+ @property (nonatomic, class, nonnull, readonly) SDWebImageTransition *flipFromBottomTransition;
96
+ /// Curl up transition.
97
+ @property (nonatomic, class, nonnull, readonly) SDWebImageTransition *curlUpTransition;
98
+ /// Curl down transition.
99
+ @property (nonatomic, class, nonnull, readonly) SDWebImageTransition *curlDownTransition;
100
+
101
+ /// Fade-in transition with duration.
102
+ /// @param duration transition duration, use ease-in-out
103
+ + (nonnull instancetype)fadeTransitionWithDuration:(NSTimeInterval)duration NS_SWIFT_NAME(fade(duration:));
104
+
105
+ /// Flip from left transition with duration.
106
+ /// @param duration transition duration, use ease-in-out
107
+ + (nonnull instancetype)flipFromLeftTransitionWithDuration:(NSTimeInterval)duration NS_SWIFT_NAME(flipFromLeft(duration:));
108
+
109
+ /// Flip from right transition with duration.
110
+ /// @param duration transition duration, use ease-in-out
111
+ + (nonnull instancetype)flipFromRightTransitionWithDuration:(NSTimeInterval)duration NS_SWIFT_NAME(flipFromRight(duration:));
112
+
113
+ /// Flip from top transition with duration.
114
+ /// @param duration transition duration, use ease-in-out
115
+ + (nonnull instancetype)flipFromTopTransitionWithDuration:(NSTimeInterval)duration NS_SWIFT_NAME(flipFromTop(duration:));
116
+
117
+ /// Flip from bottom transition with duration.
118
+ /// @param duration transition duration, use ease-in-out
119
+ + (nonnull instancetype)flipFromBottomTransitionWithDuration:(NSTimeInterval)duration NS_SWIFT_NAME(flipFromBottom(duration:));
120
+
121
+ /// Curl up transition with duration.
122
+ /// @param duration transition duration, use ease-in-out
123
+ + (nonnull instancetype)curlUpTransitionWithDuration:(NSTimeInterval)duration NS_SWIFT_NAME(curlUp(duration:));
124
+
125
+ /// Curl down transition with duration.
126
+ /// @param duration transition duration, use ease-in-out
127
+ + (nonnull instancetype)curlDownTransitionWithDuration:(NSTimeInterval)duration NS_SWIFT_NAME(curlDown(duration:));
128
+
129
+ @end
130
+
131
+ #endif