peachsim 0.1.1716 → 0.1.1738

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 (282) hide show
  1. package/README.md +21 -3
  2. package/cli/app-bundle-resources.ts +2 -1
  3. package/cli/app-fonts.ts +4 -4
  4. package/cli/app-splash.ts +4 -4
  5. package/cli/app-stubs.ts +17 -0
  6. package/cli/command-registry.ts +1 -0
  7. package/cli/commands/control.ts +83 -822
  8. package/cli/commands/coverage-swift.ts +112 -4
  9. package/cli/commands/daemon.ts +8 -0
  10. package/cli/commands/detox.ts +3 -0
  11. package/cli/commands/doctor.ts +19 -2
  12. package/cli/commands/inspect/actions.ts +74 -14
  13. package/cli/commands/inspect/core.ts +5 -1
  14. package/cli/commands/inspect/settling.ts +5 -2
  15. package/cli/commands/inspect/wait-ready.ts +6 -0
  16. package/cli/commands/inspect.ts +48 -45
  17. package/cli/commands/kotlin.ts +12 -2
  18. package/cli/commands/package.ts +760 -0
  19. package/cli/commands/serve.ts +6 -0
  20. package/cli/commands/shell-url.ts +838 -0
  21. package/cli/commands/swift.ts +42 -102
  22. package/cli/commands/test.ts +20 -0
  23. package/cli/commands/upload.ts +1 -1
  24. package/cli/device-option.ts +1 -1
  25. package/cli/main.ts +13 -1
  26. package/cli/native-input.ts +199 -0
  27. package/cli/outbound-endpoints.ts +26 -1
  28. package/cli/packaged-app-launcher.ts +95 -0
  29. package/cli/scene-video.ts +36 -12
  30. package/detox/index.ts +196 -24
  31. package/dist-lib/agent-daemon-client.cjs +1 -1
  32. package/dist-lib/agent-events.cjs +1 -1
  33. package/dist-lib/attached-projects.cjs +5 -2
  34. package/dist-lib/auth/shared-session.cjs +5 -2
  35. package/dist-lib/backend-origin.cjs +1 -1
  36. package/dist-lib/beta.cjs +1 -1
  37. package/dist-lib/beta.mjs +1 -1
  38. package/dist-lib/bridge-constants.cjs +1 -1
  39. package/dist-lib/bridge-contract-input.cjs +1 -1
  40. package/dist-lib/bridge-contract-input.mjs +1 -1
  41. package/dist-lib/bridge-contract.cjs +1 -1
  42. package/dist-lib/bridge-contract.mjs +1 -1
  43. package/dist-lib/bundle-channel.cjs +39889 -31873
  44. package/dist-lib/capture-contract.cjs +1 -1
  45. package/dist-lib/capture-contract.mjs +1 -1
  46. package/dist-lib/cloud-contract.cjs +1 -1
  47. package/dist-lib/cloud-contract.mjs +1 -1
  48. package/dist-lib/cloud-test-args.cjs +1 -1
  49. package/dist-lib/cloud-test-args.mjs +1 -1
  50. package/dist-lib/cloud.cjs +1 -1
  51. package/dist-lib/cloud.mjs +1 -1
  52. package/dist-lib/config.cjs +1 -1
  53. package/dist-lib/config.mjs +1 -1
  54. package/dist-lib/detox/index.cjs +195 -63
  55. package/dist-lib/dev-bundle-resolution.cjs +14 -13
  56. package/dist-lib/expo-swift-bundle.cjs +18507 -11835
  57. package/dist-lib/expo-swift-metadata.cjs +4 -1
  58. package/dist-lib/expo-swift-metadata.mjs +3 -1
  59. package/dist-lib/home-paths.cjs +27 -3
  60. package/dist-lib/host/bridge-host.cjs +28373 -24090
  61. package/dist-lib/host/fetch-proxy-handler.cjs +235 -225
  62. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  63. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  64. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  65. package/dist-lib/host/websocket-proxy.cjs +1 -1
  66. package/dist-lib/index.cjs +915 -399
  67. package/dist-lib/jump-to-source-babel.cjs +1 -1
  68. package/dist-lib/jump-to-source-native.cjs +1 -1
  69. package/dist-lib/kotlin-host.cjs +335 -47
  70. package/dist-lib/menu.cjs +13 -1
  71. package/dist-lib/menu.mjs +13 -1
  72. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  73. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  74. package/dist-lib/metro-production-bundle.cjs +1 -1
  75. package/dist-lib/metro-production-bundle.mjs +1 -1
  76. package/dist-lib/metro.cjs +918 -411
  77. package/dist-lib/native-app-identity-project.cjs +703 -283
  78. package/dist-lib/native-app-identity-project.mjs +500 -87
  79. package/dist-lib/native-app-identity.cjs +13 -2
  80. package/dist-lib/native-app-identity.mjs +13 -2
  81. package/dist-lib/native-firebase-metadata.cjs +1 -1
  82. package/dist-lib/native-firebase-metadata.mjs +1 -1
  83. package/dist-lib/plist.cjs +1 -1
  84. package/dist-lib/plist.mjs +1 -1
  85. package/dist-lib/profiles.cjs +5 -2
  86. package/dist-lib/public-brand.cjs +1 -1
  87. package/dist-lib/public-origins-lib-esm.json +28 -23
  88. package/dist-lib/public-origins-lib.json +418 -224
  89. package/dist-lib/react-native-host-modules.cjs +35 -2
  90. package/dist-lib/react-native-host-modules.mjs +35 -2
  91. package/dist-lib/reap-browser.cjs +12 -4
  92. package/dist-lib/scripts/dev-server-scanner.cjs +15 -8
  93. package/dist-lib/sdk.cjs +17 -7
  94. package/dist-lib/sdk.mjs +16 -7
  95. package/dist-lib/skills.cjs +44825 -29141
  96. package/dist-lib/swift-compile.cjs +616 -400
  97. package/dist-lib/swift-compile.mjs +528 -315
  98. package/dist-lib/swift-package.cjs +1 -1
  99. package/dist-lib/swift-package.mjs +1 -1
  100. package/dist-lib/swift-submit.cjs +2 -2
  101. package/dist-lib/swift-submit.mjs +2 -2
  102. package/dist-lib/swift-toolchain.cjs +105 -17
  103. package/dist-lib/swift.cjs +1 -1
  104. package/dist-lib/vite-swift.cjs +4660 -2252
  105. package/dist-lib/vite.cjs +248 -234
  106. package/dist-lib/worklet-executable.cjs +1 -1
  107. package/dist-lib/worklet-executable.mjs +1 -1
  108. package/dist-types/packages/peach-compat/src/stubs/native-seams/react-native-cookies.d.ts +17 -8
  109. package/dist-types/packages/peach-engine/src/engine/canvaskit-renderer.d.ts +1 -0
  110. package/dist-types/packages/peach-engine/src/engine/font-config.d.ts +7 -4
  111. package/dist-types/packages/peach-engine/src/engine/image-loader.d.ts +9 -6
  112. package/dist-types/packages/peach-engine/src/engine/liquid-glass.d.ts +0 -5
  113. package/dist-types/packages/peach-engine/src/engine/memory-counts.d.ts +11 -1
  114. package/dist-types/packages/peach-engine/src/engine/node.d.ts +5 -12
  115. package/dist-types/packages/peach-engine/src/engine/render-damage.d.ts +2 -2
  116. package/dist-types/packages/peach-engine/src/engine/text-first-baseline.d.ts +5 -0
  117. package/dist-types/packages/peach-engine/src/engine/text-paragraph.d.ts +1 -0
  118. package/dist-types/packages/peach-engine/src/engine/types.d.ts +3 -0
  119. package/dist-types/packages/peach-engine/src/native-preview-bundle.d.ts +2 -0
  120. package/dist-types/packages/peach-engine/src/render-worker/compositor-protocol.d.ts +9 -0
  121. package/dist-types/packages/peach-engine/src/render-worker/host-service-protocol.d.ts +3 -0
  122. package/dist-types/packages/peach-engine/src/render-worker/native-ui-commandContract.d.ts +1 -1
  123. package/dist-types/packages/peach-engine/src/render-worker/protocol.d.ts +7 -2
  124. package/dist-types/packages/peach-engine/src/render-worker/shell-protocol.d.ts +5 -0
  125. package/dist-types/packages/peach-engine/src/render-worker/tree-sync-port.d.ts +1 -1
  126. package/dist-types/packages/peach-engine/src/render-worker/worklet-runtime.d.ts +36 -2
  127. package/dist-types/packages/peach-engine/src/shell-events.d.ts +1 -0
  128. package/dist-types/packages/peach-globals/src/audioBridgeContract.d.ts +5 -0
  129. package/dist-types/packages/peach-globals/src/index.d.ts +1 -1
  130. package/dist-types/packages/peach-globals/src/keyboardBridgeContract.d.ts +11 -0
  131. package/dist-types/packages/peach-globals/src/shellBridgeContract.d.ts +1 -0
  132. package/dist-types/packages/peach-globals/src/testBridgeContract.d.ts +9 -2
  133. package/dist-types/packages/peach-kit/src/capabilities.d.ts +1 -0
  134. package/kotlin/README.md +3 -0
  135. package/kotlin/sdk.tar.gz +0 -0
  136. package/package.json +1 -1
  137. package/runtime-companion.json +1 -1
  138. package/scripts/dev-server-scanner.ts +12 -25
  139. package/sdk/ios/System/Library/Frameworks/Accounts.framework/Headers/ACAccount.h +55 -0
  140. package/sdk/ios/System/Library/Frameworks/Accounts.framework/Headers/ACAccountCredential.h +35 -0
  141. package/sdk/ios/System/Library/Frameworks/Accounts.framework/Headers/ACAccountStore.h +94 -0
  142. package/sdk/ios/System/Library/Frameworks/Accounts.framework/Headers/ACAccountType.h +53 -0
  143. package/sdk/ios/System/Library/Frameworks/Accounts.framework/Headers/ACError.h +37 -0
  144. package/sdk/ios/System/Library/Frameworks/Accounts.framework/Headers/Accounts.h +13 -0
  145. package/sdk/ios/System/Library/Frameworks/Accounts.framework/Headers/AccountsDefines.h +13 -0
  146. package/sdk/ios/System/Library/Frameworks/Accounts.framework/Modules/module.modulemap +5 -0
  147. package/sdk/ios/System/Library/Frameworks/AuthenticationServices.framework/Headers/ASFoundation.h +52 -0
  148. package/sdk/ios/System/Library/Frameworks/AuthenticationServices.framework/Headers/ASWebAuthenticationSession.h +128 -0
  149. package/sdk/ios/System/Library/Frameworks/AuthenticationServices.framework/Headers/ASWebAuthenticationSessionCallback.h +35 -0
  150. package/sdk/ios/System/Library/Frameworks/AuthenticationServices.framework/Headers/AuthenticationServices.h +3 -0
  151. package/sdk/ios/System/Library/Frameworks/AuthenticationServices.framework/Modules/module.modulemap +5 -0
  152. package/sdk/ios/System/Library/Frameworks/CFNetwork.framework/Headers/CFHTTPMessage.h +724 -0
  153. package/sdk/ios/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetwork.h +4 -0
  154. package/sdk/ios/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetworkDefs.h +27 -0
  155. package/sdk/ios/System/Library/Frameworks/CFNetwork.framework/Modules/module.modulemap +5 -0
  156. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFURL.h +1301 -0
  157. package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.h +3 -1
  158. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLLocationManager.h +21 -50
  159. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLRegion.h +6 -6
  160. package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes +58 -3
  161. package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h +711 -46
  162. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h +12 -0
  163. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIInterface.h +23 -0
  164. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h +7 -9
  165. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIOrientation.h +14 -0
  166. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIStringDrawing.h +12 -0
  167. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIView.h +14 -0
  168. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIViewAnimating.h +12 -0
  169. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIViewController.h +16 -0
  170. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIWindow.h +2 -0
  171. package/sdk/ios/usr/include/ConditionalMacros.h +619 -0
  172. package/sdk/ios/usr/include/module.modulemap +1 -0
  173. package/sdk/ios/usr/include/objc/objc-sync.h +59 -0
  174. package/sdk/ios/usr/include/os/signpost.h +414 -0
  175. package/sdk/ios/usr/include/os.modulemap +10 -0
  176. package/sdk/ios/usr/include/sys/cdefs.h +5 -0
  177. package/sdk/ios/usr/include/sys/ioccom.h +99 -0
  178. package/sdk/ios/usr/include/sys/syslog.h +236 -0
  179. package/sdk/ios/usr/include/syslog.h +24 -0
  180. package/sdk/ios/wasm/include/errno.h +4 -20
  181. package/sdk/ios/wasm/include/fcntl.h +4 -2
  182. package/sdk/ios/wasm/include/pthread.h +3 -0
  183. package/sdk/ios/wasm/include/setjmp.h +57 -0
  184. package/sdk/ios/wasm/include/stdio.h +24 -0
  185. package/sdk/ios/wasm/include/stdlib.h +32 -7
  186. package/sdk/ios/wasm/include/sys/file.h +7 -0
  187. package/sdk/ios/wasm/include/sys/ioctl.h +6 -0
  188. package/sdk/ios/wasm/include/sys/resource.h +2 -2
  189. package/sdk/ios/wasm/include/sys/syscall.h +9 -0
  190. package/sdk/ios/wasm/include/sys/time.h +10 -0
  191. package/sdk/ios/wasm/include/unistd.h +12 -3
  192. package/sdk/native-hashes.json +4 -3
  193. package/skills/contrast/SKILL.md +2 -1
  194. package/skills/peach-debug/SKILL.md +0 -1
  195. package/skills/peach-perf/SKILL.md +0 -1
  196. package/skills/peach-setup/SKILL.md +0 -1
  197. package/skills/peach-test/SKILL.md +7 -4
  198. package/skills/peach-visual/SKILL.md +0 -1
  199. package/src/admitted-mac-build.ts +3 -0
  200. package/src/android-app-identity.ts +18 -0
  201. package/src/android-autolinking.ts +1 -0
  202. package/src/android-bridge-packages.ts +279 -0
  203. package/src/android-root-module.ts +9 -9
  204. package/src/appPackageContract.ts +83 -0
  205. package/src/bridge-contract.ts +50 -0
  206. package/src/bundle-channel.mjs +41 -6
  207. package/src/cli-runtime.ts +9 -5
  208. package/src/dev-bundle-resolution.ts +7 -27
  209. package/src/dom-source-reference.ts +15 -0
  210. package/src/expo-discovery-cache.ts +134 -26
  211. package/src/expo-kotlin-host.ts +97 -26
  212. package/src/expo-manifest-body.ts +33 -0
  213. package/src/expo-native-workspace.ts +158 -38
  214. package/src/expo-swift-host.ts +350 -75
  215. package/src/expo-swift-ready.ts +5 -1
  216. package/src/expoKotlinContract.ts +12 -2
  217. package/src/expoSwiftContract.ts +10 -0
  218. package/src/generated/swift-c-predefines.json +1 -1
  219. package/src/home-paths.ts +41 -2
  220. package/src/host/app-package-handler.ts +47 -0
  221. package/src/host/bridge-host.ts +8 -0
  222. package/src/host/fetch-proxy-handler.ts +10 -0
  223. package/src/host/staged-host-files.ts +18 -0
  224. package/src/index.ts +3 -0
  225. package/src/kotlin-host.ts +225 -48
  226. package/src/kotlin-instance-source.ts +126 -0
  227. package/src/kotlinSdkContract.ts +2 -1
  228. package/src/menu.ts +14 -0
  229. package/src/native-app-identity-project.ts +7 -2
  230. package/src/native-app-identity.ts +11 -0
  231. package/src/native-firebase-config.ts +24 -1
  232. package/src/native-prebuilt.ts +154 -0
  233. package/src/nitro-adapter.lock.json +270 -270
  234. package/src/nitro-adapter.ts +56 -50
  235. package/src/nitro-bundle.ts +92 -74
  236. package/src/nitro-compile.ts +45 -14
  237. package/src/nitro-dependencies.ts +63 -46
  238. package/src/nitro-source.ts +64 -26
  239. package/src/nitroAdapterContract.ts +146 -98
  240. package/src/nitroContract.ts +71 -21
  241. package/src/react-native-bridge-modules.ts +70 -42
  242. package/src/react-native-host-modules.ts +34 -1
  243. package/src/reactNativeConfigurationContract.ts +14 -0
  244. package/src/reap-browser.ts +15 -3
  245. package/src/sdk.ts +5 -0
  246. package/src/settingsContract.ts +38 -1
  247. package/src/sim-client.ts +4 -1
  248. package/src/storageSnapshotContract.ts +32 -81
  249. package/src/swift-compile.ts +268 -89
  250. package/src/swift-coverage/indexdump.ts +22 -6
  251. package/src/swift-coverage/indexing.ts +4 -4
  252. package/src/swift-coverage/provenance.ts +1 -0
  253. package/src/swift-coverage/sdk.ts +104 -20
  254. package/src/swift-coverage/types.ts +34 -0
  255. package/src/swift-coverage/xcode-asset-symbols.ts +922 -0
  256. package/src/swift-coverage/xcode-assets.ts +89 -131
  257. package/src/swift-coverage/xcode.ts +10 -2
  258. package/src/swift-cxx-reachable.ts +2 -1
  259. package/src/swift-distribution.lock.json +20 -16
  260. package/src/swift-host.ts +98 -22
  261. package/src/swift-icu.ts +1 -1
  262. package/src/swift-link-roots.ts +118 -0
  263. package/src/swift-objc-compile.ts +144 -22
  264. package/src/swift-objc-import.ts +6 -0
  265. package/src/swift-objc-standin.ts +2 -14
  266. package/src/swift-package-manifest.ts +14 -6
  267. package/src/swift-packages.ts +75 -11
  268. package/src/swift-pdf-raster.ts +1 -0
  269. package/src/swift-root-lock.ts +17 -1
  270. package/src/swift-source-pods.ts +2 -10
  271. package/src/swift-standin-emit.ts +597 -57
  272. package/src/swift-standins.ts +599 -56
  273. package/src/swift-submit.ts +7 -1
  274. package/src/swift-toolchain.ts +140 -17
  275. package/src/turbo-bundle.ts +81 -0
  276. package/src/turbo-codegen-intake.ts +91 -0
  277. package/src/turbo-compile.ts +120 -0
  278. package/src/turbo-runtime.lock.json +69 -0
  279. package/src/turbo-source.ts +754 -0
  280. package/src/vite-plugin-one.ts +17 -12
  281. package/src/vite-plugin.ts +28 -15
  282. package/src/xcode-project.ts +223 -22
@@ -62,20 +62,20 @@ typedef void NSUncaughtExceptionHandler(NSException * _Nonnull exception);
62
62
  #endif
63
63
  #endif
64
64
  #endif
65
- #define FOUNDATION_EXPORT extern
65
+ #if defined(__cplusplus)
66
+ #define FOUNDATION_EXTERN extern "C"
67
+ #else
66
68
  #define FOUNDATION_EXTERN extern
69
+ #endif
70
+ #define FOUNDATION_EXPORT FOUNDATION_EXTERN
67
71
  #define FOUNDATION_STATIC_INLINE static inline
68
72
  #define NS_INLINE static inline
69
- #define CF_EXPORT extern
70
- #define OBJC_EXPORT extern
71
73
  #define NS_ASSUME_NONNULL_BEGIN _Pragma("clang assume_nonnull begin")
72
74
  #define NS_ASSUME_NONNULL_END _Pragma("clang assume_nonnull end")
73
75
  #define CF_ASSUME_NONNULL_BEGIN _Pragma("clang assume_nonnull begin")
74
76
  #define CF_ASSUME_NONNULL_END _Pragma("clang assume_nonnull end")
75
77
  #define NS_HEADER_AUDIT_BEGIN(...) _Pragma("clang assume_nonnull begin")
76
78
  #define NS_HEADER_AUDIT_END(...) _Pragma("clang assume_nonnull end")
77
- #define CF_EXTERN_C_BEGIN
78
- #define CF_EXTERN_C_END
79
79
  #include <sys/cdefs.h>
80
80
 
81
81
  #define NS_ENUM(...) CF_ENUM(__VA_ARGS__)
@@ -1051,8 +1051,38 @@ __attribute__((swift_bridge("Swift.Set")))
1051
1051
  - (instancetype)initWithObjects:(ObjectType)firstObj, ... NS_REQUIRES_NIL_TERMINATION;
1052
1052
  @end
1053
1053
  @interface NSOrderedSet<__covariant ObjectType> : NSObject <NSCopying, NSMutableCopying, NSSecureCoding, NSFastEnumeration>
1054
+ @property (readonly) NSUInteger count;
1055
+ - (ObjectType)objectAtIndex:(NSUInteger)idx;
1056
+ - (NSUInteger)indexOfObject:(ObjectType)object;
1057
+ - (instancetype)init NS_DESIGNATED_INITIALIZER;
1058
+ - (instancetype)initWithObjects:(const ObjectType _Nonnull [_Nullable])objects count:(NSUInteger)cnt NS_DESIGNATED_INITIALIZER;
1059
+ - (nullable instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
1060
+ - (ObjectType)objectAtIndexedSubscript:(NSUInteger)idx API_AVAILABLE(macos(10.8), ios(6.0), watchos(2.0), tvos(9.0));
1054
1061
  @end
1055
1062
  @interface NSMutableOrderedSet<ObjectType> : NSOrderedSet<ObjectType>
1063
+ - (void)insertObject:(ObjectType)object atIndex:(NSUInteger)idx;
1064
+ - (void)removeObjectAtIndex:(NSUInteger)idx;
1065
+ - (void)replaceObjectAtIndex:(NSUInteger)idx withObject:(ObjectType)object;
1066
+ - (void)setObject:(ObjectType)obj atIndexedSubscript:(NSUInteger)idx API_AVAILABLE(macos(10.8), ios(6.0), watchos(2.0), tvos(9.0));
1067
+ - (nullable instancetype)initWithCoder:(NSCoder *)coder NS_DESIGNATED_INITIALIZER;
1068
+ - (instancetype)init NS_DESIGNATED_INITIALIZER;
1069
+ - (instancetype)initWithCapacity:(NSUInteger)numItems NS_DESIGNATED_INITIALIZER;
1070
+ @end
1071
+ @interface NSMutableOrderedSet<ObjectType> (NSExtendedMutableOrderedSet)
1072
+ - (void)addObject:(ObjectType)object;
1073
+ - (void)addObjectsFromArray:(NSArray<ObjectType> *)array;
1074
+ - (void)removeAllObjects;
1075
+ @end
1076
+ @interface NSOrderedSet<ObjectType> (NSOrderedSetCreation)
1077
+ - (instancetype)initWithObject:(ObjectType)object;
1078
+ - (instancetype)initWithOrderedSet:(NSOrderedSet<ObjectType> *)set;
1079
+ - (instancetype)initWithOrderedSet:(NSOrderedSet<ObjectType> *)set copyItems:(BOOL)flag;
1080
+ - (instancetype)initWithOrderedSet:(NSOrderedSet<ObjectType> *)set range:(NSRange)range copyItems:(BOOL)flag;
1081
+ - (instancetype)initWithArray:(NSArray<ObjectType> *)array;
1082
+ - (instancetype)initWithArray:(NSArray<ObjectType> *)array copyItems:(BOOL)flag;
1083
+ - (instancetype)initWithArray:(NSArray<ObjectType> *)array range:(NSRange)range copyItems:(BOOL)flag;
1084
+ - (instancetype)initWithSet:(NSSet<ObjectType> *)set;
1085
+ - (instancetype)initWithSet:(NSSet<ObjectType> *)set copyItems:(BOOL)flag;
1056
1086
  @end
1057
1087
  @interface NSEnumerator<ObjectType> : NSObject <NSFastEnumeration>
1058
1088
  - (nullable ObjectType)nextObject;
@@ -1362,6 +1392,8 @@ NS_SWIFT_SENDABLE
1362
1392
  - (void)removeCachedResourceValueForKey:(NSURLResourceKey)key API_AVAILABLE(macos(10.9), ios(7.0), watchos(2.0), tvos(9.0));
1363
1393
  - (void)removeAllCachedResourceValues API_AVAILABLE(macos(10.9), ios(7.0), watchos(2.0), tvos(9.0));
1364
1394
  - (void)setTemporaryResourceValue:(nullable NS_SWIFT_SENDABLE id)value forKey:(NSURLResourceKey)key API_AVAILABLE(macos(10.9), ios(7.0), watchos(2.0), tvos(9.0));
1395
+ - (BOOL)startAccessingSecurityScopedResource API_AVAILABLE(macos(10.7), ios(8.0), watchos(2.0), tvos(9.0));
1396
+ - (void)stopAccessingSecurityScopedResource API_AVAILABLE(macos(10.7), ios(8.0), watchos(2.0), tvos(9.0));
1365
1397
 
1366
1398
 
1367
1399
 
@@ -1578,6 +1610,7 @@ __attribute__((swift_bridge("URLRequest")))
1578
1610
  @property (nullable, copy) NSData *HTTPBody;
1579
1611
  @end
1580
1612
  NS_SWIFT_NAME(URLResponse)
1613
+ NS_SWIFT_SENDABLE
1581
1614
  @interface NSURLResponse : NSObject <NSCopying, NSSecureCoding>
1582
1615
  - (instancetype)initWithURL:(NSURL *)URL MIMEType:(nullable NSString *)MIMEType expectedContentLength:(NSInteger)length textEncodingName:(nullable NSString *)name;
1583
1616
  @property (nullable, readonly, copy) NSString *textEncodingName;
@@ -1587,6 +1620,7 @@ NS_SWIFT_NAME(URLResponse)
1587
1620
  @property (nullable, readonly, copy) NSURL *URL;
1588
1621
  @end
1589
1622
  NS_SWIFT_NAME(HTTPURLResponse)
1623
+ NS_SWIFT_SENDABLE
1590
1624
  @interface NSHTTPURLResponse : NSURLResponse
1591
1625
  + (NSString *)localizedStringForStatusCode:(NSInteger)statusCode;
1592
1626
  - (nullable NSString *)valueForHTTPHeaderField:(NSString *)field;
@@ -1670,10 +1704,20 @@ __attribute__((availability(macos,introduced=10.2), availability(ios,introduced=
1670
1704
  - (void)storeCookies:(NSArray<NSHTTPCookie *> *)cookies forTask:(NSURLSessionTask *)task __attribute__((availability(macos,introduced=10.10), availability(ios,introduced=8.0), availability(watchos,introduced=2.0), availability(tvos,introduced=9.0)));
1671
1705
  - (void)getCookiesForTask:(NSURLSessionTask *)task completionHandler:(void (NS_SWIFT_SENDABLE ^) (NSArray<NSHTTPCookie *> * _Nullable cookies))completionHandler __attribute__((availability(macos,introduced=10.10), availability(ios,introduced=8.0), availability(watchos,introduced=2.0), availability(tvos,introduced=9.0)));
1672
1706
  @end
1673
- NS_SWIFT_NAME(URLSessionDelegate)
1674
- @protocol NSURLSessionDelegate <NSObject>
1675
- @end
1676
- NS_SWIFT_NAME(URLSessionTaskDelegate)
1707
+ @class NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, NSURLCredential, NSInputStream, NSOutputStream, NSURLSessionTaskMetrics, NSHTTPURLResponse, NSURLSessionDataTask, NSURLSessionDownloadTask, NSURLSessionStreamTask, NSCachedURLResponse, NSURLSessionUploadTask, NSURLSessionWebSocketTask, NSURLSessionConfiguration, NSURLSessionTaskTransactionMetrics, NSProgress, NSURLCredentialStorage;
1708
+ typedef NS_ENUM(NSInteger, NSURLSessionWebSocketCloseCode);
1709
+ typedef NS_ENUM(NSUInteger, NSURLRequestNetworkServiceType)
1710
+ {
1711
+ NSURLNetworkServiceTypeDefault = 0,
1712
+ NSURLNetworkServiceTypeVoIP API_DEPRECATED("Use PushKit for VoIP control purposes", macos(10.7,10.15), ios(4.0,13.0), watchos(2.0,6.0), tvos(9.0,13.0)) = 1,
1713
+ NSURLNetworkServiceTypeVideo = 2,
1714
+ NSURLNetworkServiceTypeBackground = 3,
1715
+ NSURLNetworkServiceTypeVoice = 4,
1716
+ NSURLNetworkServiceTypeResponsiveData = 6,
1717
+ NSURLNetworkServiceTypeAVStreaming API_AVAILABLE(macosx(10.9), ios(7.0), watchos(2.0), tvos(9.0)) = 8 ,
1718
+ NSURLNetworkServiceTypeResponsiveAV API_AVAILABLE(macosx(10.9), ios(7.0), watchos(2.0), tvos(9.0)) = 9,
1719
+ NSURLNetworkServiceTypeCallSignaling API_AVAILABLE(macosx(10.12), ios(10.0), watchos(3.0), tvos(10.0)) = 11,
1720
+ };
1677
1721
  typedef NS_ENUM(NSInteger, NSURLSessionAuthChallengeDisposition) {
1678
1722
  NSURLSessionAuthChallengeUseCredential = 0,
1679
1723
  NSURLSessionAuthChallengePerformDefaultHandling = 1,
@@ -1690,8 +1734,17 @@ typedef NS_ENUM(NSInteger, NSURLSessionDelayedRequestDisposition) {
1690
1734
  NSURLSessionDelayedRequestContinueLoading = 0,
1691
1735
  NSURLSessionDelayedRequestUseNewRequest = 1,
1692
1736
  NSURLSessionDelayedRequestCancel = 2,
1693
- } __attribute__((availability(macos,introduced=10.13), availability(ios,introduced=11.0), availability(watchos,introduced=4.0), availability(tvos,introduced=11.0)));
1694
- @class NSURLSession, NSURLSessionTask, NSURLAuthenticationChallenge, NSURLCredential, NSInputStream, NSURLSessionTaskMetrics, NSHTTPURLResponse, NSURLSessionDataTask, NSURLSessionDownloadTask, NSURLSessionStreamTask, NSCachedURLResponse;
1737
+ } NS_SWIFT_NAME(URLSession.DelayedRequestDisposition) __attribute__((availability(macos,introduced=10.13), availability(ios,introduced=11.0), availability(watchos,introduced=4.0), availability(tvos,introduced=11.0)));
1738
+ NS_SWIFT_NAME(URLSessionDelegate)
1739
+ NS_SWIFT_SENDABLE
1740
+ API_AVAILABLE(macos(10.9), ios(7.0), watchos(2.0), tvos(9.0))
1741
+ @protocol NSURLSessionDelegate <NSObject>
1742
+ @optional
1743
+ - (void)URLSession:(NSURLSession *)session didBecomeInvalidWithError:(nullable NSError *)error;
1744
+ - (void)URLSession:(NSURLSession *)session didReceiveChallenge:(NSURLAuthenticationChallenge *)challenge
1745
+ completionHandler:(void (NS_SWIFT_SENDABLE ^)(NSURLSessionAuthChallengeDisposition disposition, NSURLCredential * _Nullable credential))completionHandler;
1746
+ - (void)URLSessionDidFinishEventsForBackgroundURLSession:(NSURLSession *)session API_AVAILABLE(macos(11.0), ios(7.0), watchos(2.0), tvos(9.0));
1747
+ @end
1695
1748
  @protocol NSURLSessionTaskDelegate <NSURLSessionDelegate>
1696
1749
  @optional
1697
1750
  - (void)URLSession:(NSURLSession *)session didCreateTask:(NSURLSessionTask *)task
@@ -1713,7 +1766,7 @@ typedef NS_ENUM(NSInteger, NSURLSessionDelayedRequestDisposition) {
1713
1766
  needNewBodyStream:(void (NS_SWIFT_SENDABLE ^)(NSInputStream * _Nullable bodyStream))completionHandler NS_SWIFT_ASYNC_NAME(urlSession(_:needNewBodyStreamForTask:));
1714
1767
  - (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task
1715
1768
  needNewBodyStreamFromOffset:(int64_t)offset
1716
- completionHandler:(void (NS_SWIFT_SENDABLE ^)(NSInputStream * _Nullable bodyStream))completionHandler NS_SWIFT_ASYNC_NAME(urlSession(_:needNewBodyStreamForTask:from:)) __attribute__((availability(macos,introduced=14.0), availability(ios,introduced=17.0), availability(watchos,introduced=10.0), availability(tvos,introduced=17.0)));
1769
+ completionHandler:(void (NS_SWIFT_SENDABLE ^)(NSInputStream * _Nullable bodyStream))completionHandler NS_SWIFT_NAME(urlSession(_:task:needNewBodyStreamFrom:completionHandler:)) NS_SWIFT_ASYNC_NAME(urlSession(_:needNewBodyStreamForTask:from:)) __attribute__((availability(macos,introduced=14.0), availability(ios,introduced=17.0), availability(watchos,introduced=10.0), availability(tvos,introduced=17.0)));
1717
1770
  - (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task
1718
1771
  didSendBodyData:(int64_t)bytesSent
1719
1772
  totalBytesSent:(int64_t)totalBytesSent
@@ -1740,49 +1793,501 @@ NS_SWIFT_NAME(URLSessionDataDelegate)
1740
1793
  willCacheResponse:(NSCachedURLResponse *)proposedResponse
1741
1794
  completionHandler:(void (NS_SWIFT_SENDABLE ^)(NSCachedURLResponse * _Nullable cachedResponse))completionHandler;
1742
1795
  @end
1796
+ @protocol NSURLSessionDownloadDelegate <NSURLSessionTaskDelegate>
1797
+ - (void)URLSession:(NSURLSession *)session downloadTask:(NSURLSessionDownloadTask *)downloadTask
1798
+ didFinishDownloadingToURL:(NSURL *)location;
1799
+ @optional
1800
+ - (void)URLSession:(NSURLSession *)session downloadTask:(NSURLSessionDownloadTask *)downloadTask
1801
+ didWriteData:(int64_t)bytesWritten
1802
+ totalBytesWritten:(int64_t)totalBytesWritten
1803
+ totalBytesExpectedToWrite:(int64_t)totalBytesExpectedToWrite;
1804
+ - (void)URLSession:(NSURLSession *)session downloadTask:(NSURLSessionDownloadTask *)downloadTask
1805
+ didResumeAtOffset:(int64_t)fileOffset
1806
+ expectedTotalBytes:(int64_t)expectedTotalBytes;
1807
+ @end
1808
+ @protocol NSURLSessionStreamDelegate <NSURLSessionTaskDelegate>
1809
+ @optional
1810
+ - (void)URLSession:(NSURLSession *)session readClosedForStreamTask:(NSURLSessionStreamTask *)streamTask;
1811
+ - (void)URLSession:(NSURLSession *)session writeClosedForStreamTask:(NSURLSessionStreamTask *)streamTask;
1812
+ - (void)URLSession:(NSURLSession *)session betterRouteDiscoveredForStreamTask:(NSURLSessionStreamTask *)streamTask;
1813
+ - (void)URLSession:(NSURLSession *)session streamTask:(NSURLSessionStreamTask *)streamTask
1814
+ didBecomeInputStream:(NSInputStream *)inputStream
1815
+ outputStream:(NSOutputStream *)outputStream;
1816
+ @end
1817
+ @protocol NSURLSessionWebSocketDelegate <NSURLSessionTaskDelegate>
1818
+ @optional
1819
+ - (void)URLSession:(NSURLSession *)session webSocketTask:(NSURLSessionWebSocketTask *)webSocketTask didOpenWithProtocol:(nullable NSString *)protocol;
1820
+ - (void)URLSession:(NSURLSession *)session webSocketTask:(NSURLSessionWebSocketTask *)webSocketTask didCloseWithCode:(NSURLSessionWebSocketCloseCode)closeCode reason:(nullable NSData *)reason;
1821
+ @end
1743
1822
  @class NSURLSessionDataTask;
1823
+ @class NSNetService;
1744
1824
  NS_SWIFT_NAME(URLSession)
1745
1825
  NS_SWIFT_SENDABLE
1746
- __attribute__((availability(ios,introduced=7.0)))
1826
+ API_AVAILABLE(macos(10.9), ios(7.0), watchos(2.0), tvos(9.0))
1747
1827
  @interface NSURLSession : NSObject
1748
- - (void)invalidateAndCancel;
1828
+
1829
+ @property (class, readonly, strong) NSURLSession *sharedSession;
1830
+
1831
+ + (NSURLSession *)sessionWithConfiguration:(NSURLSessionConfiguration *)configuration;
1832
+
1833
+ + (NSURLSession *)sessionWithConfiguration:(NSURLSessionConfiguration *)configuration delegate:(nullable id <NSURLSessionDelegate>)delegate delegateQueue:(nullable NSOperationQueue *)queue;
1834
+
1835
+ @property (readonly, retain) NSOperationQueue *delegateQueue;
1836
+
1749
1837
  @property (nullable, readonly, retain) id <NSURLSessionDelegate> delegate;
1838
+
1839
+ @property (readonly, copy) NSURLSessionConfiguration *configuration;
1840
+
1841
+ @property (nullable, copy) NSString *sessionDescription;
1842
+
1750
1843
  - (void)finishTasksAndInvalidate;
1844
+
1845
+ - (void)invalidateAndCancel;
1846
+
1847
+ - (void)resetWithCompletionHandler:(void (NS_SWIFT_SENDABLE ^)(void))completionHandler;
1848
+
1849
+ - (void)flushWithCompletionHandler:(void (NS_SWIFT_SENDABLE ^)(void))completionHandler;
1850
+
1851
+ - (void)getTasksWithCompletionHandler:(void (NS_SWIFT_SENDABLE ^)(NSArray<NSURLSessionDataTask *> *dataTasks, NSArray<NSURLSessionUploadTask *> *uploadTasks, NSArray<NSURLSessionDownloadTask *> *downloadTasks))completionHandler NS_SWIFT_ASYNC_NAME(getter:tasks());
1852
+
1853
+ - (void)getAllTasksWithCompletionHandler:(void (NS_SWIFT_SENDABLE ^)(NSArray<__kindof NSURLSessionTask *> *tasks))completionHandler NS_SWIFT_ASYNC_NAME(getter:allTasks()) API_AVAILABLE(macos(10.11), ios(9.0), watchos(2.0), tvos(9.0));
1854
+
1855
+
1751
1856
  - (NSURLSessionDataTask *)dataTaskWithRequest:(NSURLRequest *)request;
1752
- @property (readonly, copy) NSURLSessionConfiguration *configuration;
1753
- + (NSURLSession *)sessionWithConfiguration:(NSURLSessionConfiguration *)configuration delegate:(nullable id <NSURLSessionDelegate>)delegate delegateQueue:(nullable NSOperationQueue *)queue;
1754
- @property (class, readonly, strong) NSURLSession * _Nonnull sharedSession;
1755
- - (NSURLSessionDataTask * _Nonnull)dataTaskWithRequest:(NSURLRequest * _Nonnull)request completionHandler:(void (NS_SWIFT_SENDABLE ^ _Nonnull)(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error))completionHandler;
1857
+
1858
+ - (NSURLSessionDataTask *)dataTaskWithURL:(NSURL *)url;
1859
+
1860
+ - (NSURLSessionUploadTask *)uploadTaskWithRequest:(NSURLRequest *)request fromFile:(NSURL *)fileURL;
1861
+
1862
+ - (NSURLSessionUploadTask *)uploadTaskWithRequest:(NSURLRequest *)request fromData:(NSData *)bodyData;
1863
+
1864
+ - (NSURLSessionUploadTask *)uploadTaskWithResumeData:(NSData *)resumeData API_AVAILABLE(macos(14.0), ios(17.0), watchos(10.0), tvos(17.0));
1865
+
1866
+ - (NSURLSessionUploadTask *)uploadTaskWithStreamedRequest:(NSURLRequest *)request;
1867
+
1868
+ - (NSURLSessionDownloadTask *)downloadTaskWithRequest:(NSURLRequest *)request;
1869
+
1870
+ - (NSURLSessionDownloadTask *)downloadTaskWithURL:(NSURL *)url;
1871
+
1872
+ - (NSURLSessionDownloadTask *)downloadTaskWithResumeData:(NSData *)resumeData;
1873
+
1874
+ - (NSURLSessionStreamTask *)streamTaskWithHostName:(NSString *)hostname port:(NSInteger)port API_AVAILABLE(macos(10.11), ios(9.0), watchos(2.0), tvos(9.0));
1875
+
1876
+ - (NSURLSessionStreamTask *)streamTaskWithNetService:(NSNetService *)service API_DEPRECATED("Use nw_connection_t in Network framework instead", macos(10.11, API_TO_BE_DEPRECATED), ios(9.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED)) API_UNAVAILABLE(watchos);
1877
+
1878
+ - (NSURLSessionWebSocketTask *)webSocketTaskWithURL:(NSURL *)url API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0));
1879
+
1880
+ - (NSURLSessionWebSocketTask *)webSocketTaskWithURL:(NSURL *)url protocols:(NSArray<NSString *>*)protocols API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0));
1881
+
1882
+ - (NSURLSessionWebSocketTask *)webSocketTaskWithRequest:(NSURLRequest *)request API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0));
1883
+
1884
+
1885
+ - (instancetype)init API_DEPRECATED("Please use +[NSURLSession sessionWithConfiguration:] or other class methods to create instances", macos(10.9,10.15), ios(7.0,13.0), watchos(2.0,6.0), tvos(9.0,13.0));
1886
+ + (instancetype)new API_DEPRECATED("Please use +[NSURLSession sessionWithConfiguration:] or other class methods to create instances", macos(10.9,10.15), ios(7.0,13.0), watchos(2.0,6.0), tvos(9.0,13.0));
1887
+
1888
+ @end
1889
+ @interface NSURLSession (NSURLSessionAsynchronousConvenience)
1890
+ - (NSURLSessionDataTask *)dataTaskWithRequest:(NSURLRequest *)request completionHandler:(void (NS_SWIFT_SENDABLE ^)(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error))completionHandler;
1891
+
1892
+ - (NSURLSessionDataTask *)dataTaskWithURL:(NSURL *)url completionHandler:(void (NS_SWIFT_SENDABLE ^)(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error))completionHandler;
1893
+
1894
+ - (NSURLSessionUploadTask *)uploadTaskWithRequest:(NSURLRequest *)request fromFile:(NSURL *)fileURL completionHandler:(void (NS_SWIFT_SENDABLE ^)(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error))completionHandler;
1895
+
1896
+ - (NSURLSessionUploadTask *)uploadTaskWithRequest:(NSURLRequest *)request fromData:(nullable NSData *)bodyData completionHandler:(void (NS_SWIFT_SENDABLE ^)(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error))completionHandler;
1897
+
1898
+ - (NSURLSessionUploadTask *)uploadTaskWithResumeData:(NSData *)resumeData completionHandler:(void (NS_SWIFT_SENDABLE ^)(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error))completionHandler API_AVAILABLE(macos(14.0), ios(17.0), watchos(10.0), tvos(17.0));
1899
+
1900
+ - (NSURLSessionDownloadTask *)downloadTaskWithRequest:(NSURLRequest *)request completionHandler:(void (NS_SWIFT_SENDABLE ^)(NSURL * _Nullable location, NSURLResponse * _Nullable response, NSError * _Nullable error))completionHandler;
1901
+
1902
+ - (NSURLSessionDownloadTask *)downloadTaskWithURL:(NSURL *)url completionHandler:(void (NS_SWIFT_SENDABLE ^)(NSURL * _Nullable location, NSURLResponse * _Nullable response, NSError * _Nullable error))completionHandler;
1903
+
1904
+ - (NSURLSessionDownloadTask *)downloadTaskWithResumeData:(NSData *)resumeData completionHandler:(void (NS_SWIFT_SENDABLE ^)(NSURL * _Nullable location, NSURLResponse * _Nullable response, NSError * _Nullable error))completionHandler;
1905
+
1756
1906
  @end
1907
+ @protocol NSProgressReporting <NSObject>
1908
+ @property (readonly, strong) NSProgress *progress;
1909
+ @end
1910
+ typedef NS_ENUM(NSInteger, NSURLSessionTaskState) {
1911
+ NSURLSessionTaskStateRunning = 0,
1912
+ NSURLSessionTaskStateSuspended = 1,
1913
+ NSURLSessionTaskStateCanceling = 2,
1914
+ NSURLSessionTaskStateCompleted = 3,
1915
+ } API_AVAILABLE(macos(10.9), ios(7.0), watchos(2.0), tvos(9.0));
1757
1916
  NS_SWIFT_NAME(URLSessionTask)
1758
1917
  NS_SWIFT_SENDABLE
1759
- __attribute__((availability(ios,introduced=7.0)))
1760
- @interface NSURLSessionTask : NSObject <NSCopying>
1761
- @property (readonly) NSUInteger taskIdentifier;
1918
+ API_AVAILABLE(macos(10.9), ios(7.0), watchos(2.0), tvos(9.0))
1919
+ @interface NSURLSessionTask : NSObject <NSCopying, NSProgressReporting>
1920
+
1921
+ @property (readonly) NSInteger taskIdentifier;
1922
+
1923
+ @property (nullable, readonly, copy) NSURLRequest *originalRequest;
1924
+
1925
+ @property (nullable, readonly, copy) NSURLRequest *currentRequest;
1926
+
1927
+ @property (nullable, readonly, copy) NSURLResponse *response;
1928
+
1929
+ @property (nullable, retain) id <NSURLSessionTaskDelegate> delegate API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0));
1930
+
1931
+ @property (readonly, strong) NSProgress *progress API_AVAILABLE(macos(10.13), ios(11.0), watchos(4.0), tvos(11.0));
1932
+
1933
+ @property (nullable, copy) NSDate *earliestBeginDate API_AVAILABLE(macos(10.13), ios(11.0), watchos(4.0), tvos(11.0));
1934
+
1935
+ @property int64_t countOfBytesClientExpectsToSend API_AVAILABLE(macos(10.13), ios(11.0), watchos(4.0), tvos(11.0));
1936
+
1937
+ @property int64_t countOfBytesClientExpectsToReceive API_AVAILABLE(macos(10.13), ios(11.0), watchos(4.0), tvos(11.0));
1938
+
1939
+
1940
+ @property (readonly) int64_t countOfBytesSent;
1941
+
1942
+ @property (readonly) int64_t countOfBytesReceived;
1943
+
1944
+ @property (readonly) int64_t countOfBytesExpectedToSend;
1945
+
1946
+ @property (readonly) int64_t countOfBytesExpectedToReceive;
1947
+
1948
+ @property (nullable, copy) NSString *taskDescription;
1949
+
1762
1950
  - (void)cancel;
1763
- @property float priority __attribute__((availability(macos,introduced=10.10), availability(ios,introduced=8.0), availability(watchos,introduced=2.0), availability(tvos,introduced=9.0)));
1951
+
1952
+ @property (readonly) NSURLSessionTaskState state;
1953
+
1954
+ @property (nullable, readonly, copy) NSError *error;
1955
+
1956
+ - (void)suspend;
1957
+
1764
1958
  - (void)resume;
1765
- @end
1766
- NS_SWIFT_NAME(URLSessionTaskMetrics)
1767
- @interface NSURLSessionTaskMetrics : NSObject
1959
+
1960
+ @property float priority API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));
1961
+
1962
+ @property BOOL prefersIncrementalDelivery API_AVAILABLE(macos(11.3), ios(14.5), watchos(7.4), tvos(14.5));
1963
+
1964
+
1965
+ - (instancetype)init API_DEPRECATED("Not supported", macos(10.9,10.15), ios(7.0,13.0), watchos(2.0,6.0), tvos(9.0,13.0));
1966
+ + (instancetype)new API_DEPRECATED("Not supported", macos(10.9,10.15), ios(7.0,13.0), watchos(2.0,6.0), tvos(9.0,13.0));
1967
+
1768
1968
  @end
1769
1969
  NS_SWIFT_NAME(URLSessionDataTask)
1770
1970
  NS_SWIFT_SENDABLE
1771
- __attribute__((availability(ios,introduced=7.0)))
1971
+ API_AVAILABLE(macos(10.9), ios(7.0), watchos(2.0), tvos(9.0))
1772
1972
  @interface NSURLSessionDataTask : NSURLSessionTask
1973
+
1974
+ - (instancetype)init API_DEPRECATED("Please use -[NSURLSession dataTaskWithRequest:] or other NSURLSession methods to create instances", macos(10.9,10.15), ios(7.0,13.0), watchos(2.0,6.0), tvos(9.0,13.0));
1975
+ + (instancetype)new API_DEPRECATED("Please use -[NSURLSession dataTaskWithRequest:] or other NSURLSession methods to create instances", macos(10.9,10.15), ios(7.0,13.0), watchos(2.0,6.0), tvos(9.0,13.0));
1976
+
1977
+ @end
1978
+ NS_SWIFT_SENDABLE
1979
+ API_AVAILABLE(macos(10.9), ios(7.0), watchos(2.0), tvos(9.0))
1980
+ @interface NSURLSessionUploadTask : NSURLSessionDataTask
1981
+
1982
+ - (instancetype)init API_DEPRECATED("Please use -[NSURLSession uploadTaskWithStreamedRequest:] or other NSURLSession methods to create instances", macos(10.9,10.15), ios(7.0,13.0), watchos(2.0,6.0), tvos(9.0,13.0));
1983
+ + (instancetype)new API_DEPRECATED("Please use -[NSURLSession uploadTaskWithStreamedRequest:] or other NSURLSession methods to create instances", macos(10.9,10.15), ios(7.0,13.0), watchos(2.0,6.0), tvos(9.0,13.0));
1984
+
1985
+ - (void)cancelByProducingResumeData:(void (NS_SWIFT_SENDABLE ^)(NSData * _Nullable resumeData))completionHandler API_AVAILABLE(macos(14.0), ios(17.0), watchos(10.0), tvos(17.0));
1986
+
1987
+ @end
1988
+ NS_SWIFT_SENDABLE
1989
+ API_AVAILABLE(macos(10.9), ios(7.0), watchos(2.0), tvos(9.0))
1990
+ @interface NSURLSessionDownloadTask : NSURLSessionTask
1991
+
1992
+ - (void)cancelByProducingResumeData:(void (NS_SWIFT_SENDABLE ^)(NSData * _Nullable resumeData))completionHandler;
1993
+
1994
+
1995
+ - (instancetype)init API_DEPRECATED("Please use -[NSURLSession downloadTaskWithRequest:] or other NSURLSession methods to create instances", macos(10.9,10.15), ios(7.0,13.0), watchos(2.0,6.0), tvos(9.0,13.0));
1996
+ + (instancetype)new API_DEPRECATED("Please use -[NSURLSession downloadTaskWithRequest:] or other NSURLSession methods to create instances", macos(10.9,10.15), ios(7.0,13.0), watchos(2.0,6.0), tvos(9.0,13.0));
1997
+
1998
+ @end
1999
+ NS_SWIFT_SENDABLE
2000
+ API_AVAILABLE(macos(10.11), ios(9.0), watchos(2.0), tvos(9.0))
2001
+ @interface NSURLSessionStreamTask : NSURLSessionTask
2002
+
2003
+ - (void)readDataOfMinLength:(NSInteger)minBytes maxLength:(NSInteger)maxBytes timeout:(NSTimeInterval)timeout completionHandler:(void (NS_SWIFT_SENDABLE ^) (NSData * _Nullable_result data, BOOL atEOF, NSError * _Nullable error))completionHandler;
2004
+
2005
+ - (void)writeData:(NSData *)data timeout:(NSTimeInterval)timeout completionHandler:(void (NS_SWIFT_SENDABLE ^) (NSError * _Nullable error))completionHandler;
2006
+
2007
+ - (void)captureStreams;
2008
+
2009
+ - (void)closeWrite;
2010
+
2011
+ - (void)closeRead;
2012
+
2013
+ - (void)startSecureConnection;
2014
+
2015
+ - (void)stopSecureConnection API_DEPRECATED("TLS cannot be disabled once it is enabled", macos(10.9,10.15), ios(7.0,13.0), watchos(2.0,6.0), tvos(9.0,13.0));
2016
+
2017
+
2018
+ - (instancetype)init API_DEPRECATED("Please use -[NSURLSession streamTaskWithHostName:port:] or other NSURLSession methods to create instances", macos(10.9,10.15), ios(7.0,13.0), watchos(2.0,6.0), tvos(9.0,13.0));
2019
+ + (instancetype)new API_DEPRECATED("Please use -[NSURLSession streamTaskWithHostName:port:] or other NSURLSession methods to create instances", macos(10.9,10.15), ios(7.0,13.0), watchos(2.0,6.0), tvos(9.0,13.0));
2020
+
2021
+ @end
2022
+ typedef NS_ENUM(NSInteger, NSURLSessionWebSocketMessageType) {
2023
+ NSURLSessionWebSocketMessageTypeData = 0,
2024
+ NSURLSessionWebSocketMessageTypeString = 1,
2025
+ } API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0));
2026
+ NS_SWIFT_SENDABLE
2027
+ API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0))
2028
+ @interface NSURLSessionWebSocketMessage : NSObject
2029
+
2030
+ - (instancetype)initWithData:(NSData *)data NS_DESIGNATED_INITIALIZER;
2031
+
2032
+ - (instancetype)initWithString:(NSString *)string NS_DESIGNATED_INITIALIZER;
2033
+
2034
+ @property (readonly) NSURLSessionWebSocketMessageType type;
2035
+ @property (nullable, readonly, copy) NSData *data;
2036
+ @property (nullable, readonly, copy) NSString *string;
2037
+
2038
+
2039
+ - (instancetype)init NS_UNAVAILABLE;
2040
+ + (instancetype)new NS_UNAVAILABLE;
2041
+
2042
+ @end
2043
+ typedef NS_ENUM(NSInteger, NSURLSessionWebSocketCloseCode)
2044
+ {
2045
+ NSURLSessionWebSocketCloseCodeInvalid = 0,
2046
+ NSURLSessionWebSocketCloseCodeNormalClosure = 1000,
2047
+ NSURLSessionWebSocketCloseCodeGoingAway = 1001,
2048
+ NSURLSessionWebSocketCloseCodeProtocolError = 1002,
2049
+ NSURLSessionWebSocketCloseCodeUnsupportedData = 1003,
2050
+ NSURLSessionWebSocketCloseCodeNoStatusReceived = 1005,
2051
+ NSURLSessionWebSocketCloseCodeAbnormalClosure = 1006,
2052
+ NSURLSessionWebSocketCloseCodeInvalidFramePayloadData = 1007,
2053
+ NSURLSessionWebSocketCloseCodePolicyViolation = 1008,
2054
+ NSURLSessionWebSocketCloseCodeMessageTooBig = 1009,
2055
+ NSURLSessionWebSocketCloseCodeMandatoryExtensionMissing = 1010,
2056
+ NSURLSessionWebSocketCloseCodeInternalServerError = 1011,
2057
+ NSURLSessionWebSocketCloseCodeTLSHandshakeFailure = 1015,
2058
+ } API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0));
2059
+ NS_SWIFT_SENDABLE
2060
+ API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0))
2061
+ @interface NSURLSessionWebSocketTask : NSURLSessionTask
2062
+
2063
+ - (void)sendMessage:(NSURLSessionWebSocketMessage *)message completionHandler:(void (NS_SWIFT_SENDABLE ^)(NSError * _Nullable error))completionHandler;
2064
+
2065
+ - (void)receiveMessageWithCompletionHandler:(void (NS_SWIFT_SENDABLE ^)(NSURLSessionWebSocketMessage * _Nullable message, NSError * _Nullable error))completionHandler;
2066
+
2067
+ - (void)sendPingWithPongReceiveHandler:(void (NS_SWIFT_SENDABLE ^)(NSError * _Nullable error))pongReceiveHandler;
2068
+
2069
+ - (void)cancelWithCloseCode:(NSURLSessionWebSocketCloseCode)closeCode reason:(nullable NSData *)reason;
2070
+
2071
+ @property NSInteger maximumMessageSize;
2072
+
2073
+ @property (readonly) NSURLSessionWebSocketCloseCode closeCode;
2074
+
2075
+ @property (nullable, readonly, copy) NSData *closeReason;
2076
+
2077
+
2078
+ - (instancetype)init NS_UNAVAILABLE;
2079
+ + (instancetype)new NS_UNAVAILABLE;
2080
+
2081
+ @end
2082
+ typedef NS_ENUM(NSInteger, NSURLSessionMultipathServiceType)
2083
+ {
2084
+ NSURLSessionMultipathServiceTypeNone = 0,
2085
+ NSURLSessionMultipathServiceTypeHandover = 1,
2086
+ NSURLSessionMultipathServiceTypeInteractive = 2,
2087
+ NSURLSessionMultipathServiceTypeAggregate = 3
2088
+ } API_AVAILABLE(ios(11.0)) API_UNAVAILABLE(macos, watchos, tvos) NS_SWIFT_NAME(URLSessionConfiguration.MultipathServiceType);
2089
+ typedef NS_ENUM(NSInteger, NSURLSessionTaskMetricsResourceFetchType) {
2090
+ NSURLSessionTaskMetricsResourceFetchTypeUnknown,
2091
+ NSURLSessionTaskMetricsResourceFetchTypeNetworkLoad,
2092
+ NSURLSessionTaskMetricsResourceFetchTypeServerPush API_DEPRECATED("Server push is no longer supported as of iOS 17 and aligned releases", macos(10.12,15.4), ios(10.0,18.4), watchos(3.0,11.4), tvos(10.0,18.4), visionos(1.0,2.4)),
2093
+ NSURLSessionTaskMetricsResourceFetchTypeLocalCache,
2094
+ } API_AVAILABLE(macosx(10.12), ios(10.0), watchos(3.0), tvos(10.0));
2095
+ typedef NS_ENUM(NSInteger, NSURLSessionTaskMetricsDomainResolutionProtocol) {
2096
+ NSURLSessionTaskMetricsDomainResolutionProtocolUnknown,
2097
+ NSURLSessionTaskMetricsDomainResolutionProtocolUDP, /* Resolution used DNS over UDP. */
2098
+ NSURLSessionTaskMetricsDomainResolutionProtocolTCP, /* Resolution used DNS over TCP. */
2099
+ NSURLSessionTaskMetricsDomainResolutionProtocolTLS, /* Resolution used DNS over TLS. */
2100
+ NSURLSessionTaskMetricsDomainResolutionProtocolHTTPS, /* Resolution used DNS over HTTPS. */
2101
+ } API_AVAILABLE(macos(11.0), ios(14.0), watchos(7.0), tvos(14.0));
2102
+ NS_SWIFT_SENDABLE
2103
+ API_AVAILABLE(macosx(10.12), ios(10.0), watchos(3.0), tvos(10.0))
2104
+ @interface NSURLSessionTaskTransactionMetrics : NSObject
2105
+
2106
+ @property (copy, readonly) NSURLRequest *request;
2107
+
2108
+ @property (nullable, copy, readonly) NSURLResponse *response;
2109
+
2110
+
2111
+ @property (nullable, copy, readonly) NSDate *fetchStartDate;
2112
+
2113
+ @property (nullable, copy, readonly) NSDate *domainLookupStartDate;
2114
+
2115
+ @property (nullable, copy, readonly) NSDate *domainLookupEndDate;
2116
+
2117
+ @property (nullable, copy, readonly) NSDate *connectStartDate;
2118
+
2119
+ @property (nullable, copy, readonly) NSDate *secureConnectionStartDate;
2120
+
2121
+ @property (nullable, copy, readonly) NSDate *secureConnectionEndDate;
2122
+
2123
+ @property (nullable, copy, readonly) NSDate *connectEndDate;
2124
+
2125
+ @property (nullable, copy, readonly) NSDate *requestStartDate;
2126
+
2127
+ @property (nullable, copy, readonly) NSDate *requestEndDate;
2128
+
2129
+ @property (nullable, copy, readonly) NSDate *responseStartDate;
2130
+
2131
+ @property (nullable, copy, readonly) NSDate *responseEndDate;
2132
+
2133
+ @property (nullable, copy, readonly) NSString *networkProtocolName;
2134
+
2135
+ @property (assign, readonly, getter=isProxyConnection) BOOL proxyConnection;
2136
+
2137
+ @property (assign, readonly, getter=isReusedConnection) BOOL reusedConnection;
2138
+
2139
+ @property (assign, readonly) NSURLSessionTaskMetricsResourceFetchType resourceFetchType;
2140
+
2141
+ @property (readonly) int64_t countOfRequestHeaderBytesSent API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0));
2142
+
2143
+ @property (readonly) int64_t countOfRequestBodyBytesSent API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0));
2144
+
2145
+ @property (readonly) int64_t countOfRequestBodyBytesBeforeEncoding API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0));
2146
+
2147
+ @property (readonly) int64_t countOfResponseHeaderBytesReceived API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0));
2148
+
2149
+ @property (readonly) int64_t countOfResponseBodyBytesReceived API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0));
2150
+
2151
+ @property (readonly) int64_t countOfResponseBodyBytesAfterDecoding API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0));
2152
+
2153
+ @property (nullable, copy, readonly) NSString *localAddress API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0));
2154
+
2155
+ @property (nullable, copy, readonly) NSNumber *localPort API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0));
2156
+
2157
+ @property (nullable, copy, readonly) NSString *remoteAddress API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0));
2158
+
2159
+ @property (nullable, copy, readonly) NSNumber *remotePort API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0));
2160
+
2161
+ @property (nullable, copy, readonly) NSNumber *negotiatedTLSProtocolVersion API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0));
2162
+
2163
+ @property (nullable, copy, readonly) NSNumber *negotiatedTLSCipherSuite API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0));
2164
+
2165
+ @property (readonly, getter=isCellular) BOOL cellular API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0));
2166
+
2167
+ @property (readonly, getter=isExpensive) BOOL expensive API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0));
2168
+
2169
+ @property (readonly, getter=isConstrained) BOOL constrained API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0));
2170
+
2171
+ @property (readonly, getter=isMultipath) BOOL multipath API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0));
2172
+
2173
+ @property (readonly) NSURLSessionTaskMetricsDomainResolutionProtocol domainResolutionProtocol API_AVAILABLE(macos(11.0), ios(14.0), watchos(7.0), tvos(14.0));
2174
+
2175
+
2176
+ - (instancetype)init API_DEPRECATED("Not supported", macos(10.12,10.15), ios(10.0,13.0), watchos(3.0,6.0), tvos(10.0,13.0));
2177
+ + (instancetype)new API_DEPRECATED("Not supported", macos(10.12,10.15), ios(10.0,13.0), watchos(3.0,6.0), tvos(10.0,13.0));
2178
+
2179
+ @end
2180
+ NS_SWIFT_NAME(URLSessionTaskMetrics)
2181
+ NS_SWIFT_SENDABLE
2182
+ API_AVAILABLE(macosx(10.12), ios(10.0), watchos(3.0), tvos(10.0))
2183
+ @interface NSURLSessionTaskMetrics : NSObject
2184
+
2185
+ @property (copy, readonly) NSArray<NSURLSessionTaskTransactionMetrics *> *transactionMetrics;
2186
+
2187
+ @property (copy, readonly) NSDateInterval *taskInterval;
2188
+
2189
+ @property (assign, readonly) NSInteger redirectCount;
2190
+
2191
+
2192
+ - (instancetype)init API_DEPRECATED("Not supported", macos(10.12,10.15), ios(10.0,13.0), watchos(3.0,6.0), tvos(10.0,13.0));
2193
+ + (instancetype)new API_DEPRECATED("Not supported", macos(10.12,10.15), ios(10.0,13.0), watchos(3.0,6.0), tvos(10.0,13.0));
2194
+
1773
2195
  @end
1774
2196
  NS_SWIFT_NAME(URLSessionConfiguration)
1775
- @interface NSURLSessionConfiguration : NSObject <NSCopying, NSSecureCoding>
1776
- @property (nullable, retain) NSURLCache *URLCache;
1777
- @property NSTimeInterval timeoutIntervalForRequest;
2197
+ NS_SWIFT_SENDABLE
2198
+ API_AVAILABLE(macos(10.9), ios(7.0), watchos(2.0), tvos(9.0))
2199
+ @interface NSURLSessionConfiguration : NSObject <NSCopying>
2200
+
1778
2201
  @property (class, readonly, strong) NSURLSessionConfiguration *defaultSessionConfiguration;
2202
+
2203
+ @property (class, readonly, strong) NSURLSessionConfiguration *ephemeralSessionConfiguration;
2204
+
2205
+ + (NSURLSessionConfiguration *)backgroundSessionConfigurationWithIdentifier:(NSString *)identifier API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));
2206
+
2207
+ @property (nullable, readonly, copy) NSString *identifier;
2208
+
2209
+ @property NSURLRequestCachePolicy requestCachePolicy;
2210
+
2211
+ @property NSTimeInterval timeoutIntervalForRequest;
2212
+
2213
+ @property NSTimeInterval timeoutIntervalForResource;
2214
+
2215
+ @property NSURLRequestNetworkServiceType networkServiceType;
2216
+
2217
+ @property BOOL allowsCellularAccess;
2218
+
2219
+ @property BOOL allowsExpensiveNetworkAccess API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0));
2220
+
2221
+ @property BOOL allowsConstrainedNetworkAccess API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0));
2222
+
2223
+ @property BOOL allowsUltraConstrainedNetworkAccess API_AVAILABLE(macos(26.1), ios(26.1), watchos(26.1), tvos(26.1), visionos(26.1));
2224
+
2225
+ @property BOOL requiresDNSSECValidation API_AVAILABLE(macos(13.0), ios(16.0), watchos(9.0), tvos(16.0));
2226
+
2227
+ @property BOOL waitsForConnectivity API_AVAILABLE(macos(10.13), ios(11.0), watchos(4.0), tvos(11.0));
2228
+
2229
+ @property (getter=isDiscretionary) BOOL discretionary API_AVAILABLE(macos(10.10), ios(7.0), watchos(2.0), tvos(9.0));
2230
+
2231
+ @property (nullable, copy) NSString *sharedContainerIdentifier API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));
2232
+
2233
+ @property BOOL sessionSendsLaunchEvents API_AVAILABLE(macos(11.0), ios(7.0), watchos(2.0), tvos(9.0));
2234
+
2235
+ @property (nullable, copy) NSDictionary *connectionProxyDictionary;
2236
+
2237
+ @property SSLProtocol TLSMinimumSupportedProtocol API_DEPRECATED_WITH_REPLACEMENT("TLSMinimumSupportedProtocolVersion", macos(10.9, API_TO_BE_DEPRECATED), ios(7.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));
2238
+
2239
+ @property SSLProtocol TLSMaximumSupportedProtocol API_DEPRECATED_WITH_REPLACEMENT("TLSMaximumSupportedProtocolVersion", macos(10.9, API_TO_BE_DEPRECATED), ios(7.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));
2240
+
2241
+ @property tls_protocol_version_t TLSMinimumSupportedProtocolVersion API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0));
2242
+
2243
+ @property tls_protocol_version_t TLSMaximumSupportedProtocolVersion API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0));
2244
+
2245
+ @property BOOL HTTPShouldUsePipelining API_DEPRECATED("Only supported in the classic loader, please adopt HTTP/2 and HTTP/3 instead", macos(10.9,15.4), ios(7.0,18.4), watchos(2.0,11.4), tvos(9.0,18.4), visionos(1.0,2.4));
2246
+
2247
+ @property BOOL HTTPShouldSetCookies;
2248
+
2249
+ @property NSHTTPCookieAcceptPolicy HTTPCookieAcceptPolicy;
2250
+
2251
+ @property (nullable, copy) NSDictionary *HTTPAdditionalHeaders;
2252
+
2253
+ @property NSInteger HTTPMaximumConnectionsPerHost;
2254
+
2255
+ @property (nullable, retain) NSHTTPCookieStorage *HTTPCookieStorage;
2256
+
2257
+ @property (nullable, retain) NSURLCredentialStorage *URLCredentialStorage;
2258
+
2259
+ @property (nullable, retain) NSURLCache *URLCache;
2260
+
2261
+ @property BOOL shouldUseExtendedBackgroundIdleMode API_DEPRECATED("Not supported", macos(10.11,15.4), ios(9.0,18.4), watchos(2.0,11.4), tvos(9.0,18.4), visionos(1.0,2.4));
2262
+
2263
+ @property (nullable, copy) NSArray<Class> *protocolClasses;
2264
+
2265
+ @property NSURLSessionMultipathServiceType multipathServiceType API_AVAILABLE(ios(11.0)) API_UNAVAILABLE(macos, watchos, tvos);
2266
+
2267
+ @property BOOL usesClassicLoadingMode API_AVAILABLE(macos(15.4), ios(18.4), watchos(11.4), tvos(18.4), visionos(2.4));
2268
+
2269
+ @property BOOL enablesEarlyData API_AVAILABLE(macos(26.0), ios(26.0), watchos(26.0), tvos(26.0), visionos(26.0));
2270
+
2271
+
2272
+ - (instancetype)init API_DEPRECATED("Please use NSURLSessionConfiguration.defaultSessionConfiguration or other class methods to create instances", macos(10.9,10.15), ios(7.0,13.0), watchos(2.0,6.0), tvos(9.0,13.0));
2273
+ + (instancetype)new API_DEPRECATED("Please use NSURLSessionConfiguration.defaultSessionConfiguration or other class methods to create instances", macos(10.9,10.15), ios(7.0,13.0), watchos(2.0,6.0), tvos(9.0,13.0));
2274
+
2275
+ @end
2276
+ @interface NSURLSessionConfiguration (NSURLSessionDeprecated)
2277
+ + (NSURLSessionConfiguration *)backgroundSessionConfiguration:(NSString *)identifier API_DEPRECATED_WITH_REPLACEMENT("-backgroundSessionConfigurationWithIdentifier:", macos(10.9, 10.10), ios(7.0, 8.0), watchos(2.0, 2.0), tvos(9.0, 9.0));
1779
2278
  @end
1780
2279
  __attribute__((swift_bridge("UUID")))
1781
2280
  @interface NSUUID : NSObject <NSCopying, NSSecureCoding>
1782
- + (instancetype)UUID;
2281
+ - (instancetype)init NS_DESIGNATED_INITIALIZER;
2282
+ - (nullable instancetype)initWithUUIDString:(NSString *)string;
2283
+ - (instancetype)initWithUUIDBytes:(const uuid_t _Nullable)bytes;
1783
2284
  - (void)getUUIDBytes:(uuid_t _Nonnull)uuid;
2285
+ - (NSComparisonResult)compare:(NSUUID *)otherUUID API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0));
1784
2286
  @property (readonly, copy) NSString *UUIDString;
1785
2287
  @end
2288
+ @interface NSUUID (NSUUIDCreation)
2289
+ + (instancetype)UUID NS_SWIFT_UNAVAILABLE("Use init() instead");
2290
+ @end
1786
2291
  __attribute__((swift_bridge("IndexPath")))
1787
2292
  @interface NSIndexPath : NSObject <NSCopying, NSSecureCoding>
1788
2293
  @end
@@ -1795,7 +2300,22 @@ __attribute__((swift_bridge("IndexSet")))
1795
2300
  @end
1796
2301
  __attribute__((swift_bridge("CharacterSet")))
1797
2302
  @interface NSCharacterSet : NSObject <NSCopying, NSMutableCopying, NSSecureCoding>
2303
+ @property (readonly, class, copy) NSCharacterSet *controlCharacterSet;
2304
+ @property (readonly, class, copy) NSCharacterSet *whitespaceCharacterSet;
2305
+ @property (readonly, class, copy) NSCharacterSet *whitespaceAndNewlineCharacterSet;
1798
2306
  @property (readonly, class, copy) NSCharacterSet *decimalDigitCharacterSet;
2307
+ @property (readonly, class, copy) NSCharacterSet *letterCharacterSet;
2308
+ @property (readonly, class, copy) NSCharacterSet *lowercaseLetterCharacterSet;
2309
+ @property (readonly, class, copy) NSCharacterSet *uppercaseLetterCharacterSet;
2310
+ @property (readonly, class, copy) NSCharacterSet *nonBaseCharacterSet;
2311
+ @property (readonly, class, copy) NSCharacterSet *alphanumericCharacterSet;
2312
+ @property (readonly, class, copy) NSCharacterSet *decomposableCharacterSet;
2313
+ @property (readonly, class, copy) NSCharacterSet *illegalCharacterSet;
2314
+ @property (readonly, class, copy) NSCharacterSet *punctuationCharacterSet;
2315
+ @property (readonly, class, copy) NSCharacterSet *capitalizedLetterCharacterSet;
2316
+ @property (readonly, class, copy) NSCharacterSet *symbolCharacterSet;
2317
+ @property (readonly, class, copy) NSCharacterSet *newlineCharacterSet API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0));
2318
+ - (BOOL)characterIsMember:(unichar)aCharacter;
1799
2319
  + (NSCharacterSet *)characterSetWithCharactersInString:(NSString *)aString;
1800
2320
  @property (readonly, copy) NSCharacterSet *invertedSet;
1801
2321
  @end
@@ -1874,6 +2394,7 @@ __attribute__((swift_bridge("TimeZone")))
1874
2394
  @interface NSTimeZone : NSObject <NSCopying, NSSecureCoding>
1875
2395
  + (nullable instancetype)timeZoneWithName:(NSString *)tzName;
1876
2396
  @property (class, readonly, copy) NSTimeZone *localTimeZone;
2397
+ @property (readonly, copy) NSString *name;
1877
2398
  @property (nullable, readonly, copy) NSString *abbreviation;
1878
2399
  + (instancetype)timeZoneForSecondsFromGMT:(NSInteger)seconds;
1879
2400
  @end
@@ -1996,7 +2517,33 @@ typedef NS_OPTIONS(NSUInteger, NSCalendarUnit) {
1996
2517
  };
1997
2518
 
1998
2519
  typedef NSString * NSCalendarIdentifier NS_TYPED_EXTENSIBLE_ENUM;
2520
+ FOUNDATION_EXPORT NSCalendarIdentifier const NSCalendarIdentifierBangla API_AVAILABLE(macos(26.0), ios(26.0), watchos(26.0), tvos(26.0), visionos(26.0));
2521
+ FOUNDATION_EXPORT NSCalendarIdentifier const NSCalendarIdentifierBuddhist API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
2522
+ FOUNDATION_EXPORT NSCalendarIdentifier const NSCalendarIdentifierChinese API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
2523
+ FOUNDATION_EXPORT NSCalendarIdentifier const NSCalendarIdentifierCoptic API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
2524
+ FOUNDATION_EXPORT NSCalendarIdentifier const NSCalendarIdentifierDangi API_AVAILABLE(macos(26.0), ios(26.0), watchos(26.0), tvos(26.0), visionos(26.0));
2525
+ FOUNDATION_EXPORT NSCalendarIdentifier const NSCalendarIdentifierEthiopicAmeteAlem API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
2526
+ FOUNDATION_EXPORT NSCalendarIdentifier const NSCalendarIdentifierEthiopicAmeteMihret API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
1999
2527
  FOUNDATION_EXPORT NSCalendarIdentifier const NSCalendarIdentifierGregorian API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
2528
+ FOUNDATION_EXPORT NSCalendarIdentifier const NSCalendarIdentifierGujarati API_AVAILABLE(macos(26.0), ios(26.0), watchos(26.0), tvos(26.0), visionos(26.0));
2529
+ FOUNDATION_EXPORT NSCalendarIdentifier const NSCalendarIdentifierHebrew API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
2530
+ FOUNDATION_EXPORT NSCalendarIdentifier const NSCalendarIdentifierISO8601 API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
2531
+ FOUNDATION_EXPORT NSCalendarIdentifier const NSCalendarIdentifierIndian API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
2532
+ FOUNDATION_EXPORT NSCalendarIdentifier const NSCalendarIdentifierIslamic API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
2533
+ FOUNDATION_EXPORT NSCalendarIdentifier const NSCalendarIdentifierIslamicCivil API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
2534
+ FOUNDATION_EXPORT NSCalendarIdentifier const NSCalendarIdentifierIslamicTabular API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));
2535
+ FOUNDATION_EXPORT NSCalendarIdentifier const NSCalendarIdentifierIslamicUmmAlQura API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));
2536
+ FOUNDATION_EXPORT NSCalendarIdentifier const NSCalendarIdentifierJapanese API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
2537
+ FOUNDATION_EXPORT NSCalendarIdentifier const NSCalendarIdentifierKannada API_AVAILABLE(macos(26.0), ios(26.0), watchos(26.0), tvos(26.0), visionos(26.0));
2538
+ FOUNDATION_EXPORT NSCalendarIdentifier const NSCalendarIdentifierMalayalam API_AVAILABLE(macos(26.0), ios(26.0), watchos(26.0), tvos(26.0), visionos(26.0));
2539
+ FOUNDATION_EXPORT NSCalendarIdentifier const NSCalendarIdentifierMarathi API_AVAILABLE(macos(26.0), ios(26.0), watchos(26.0), tvos(26.0), visionos(26.0));
2540
+ FOUNDATION_EXPORT NSCalendarIdentifier const NSCalendarIdentifierOdia API_AVAILABLE(macos(26.0), ios(26.0), watchos(26.0), tvos(26.0), visionos(26.0));
2541
+ FOUNDATION_EXPORT NSCalendarIdentifier const NSCalendarIdentifierPersian API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
2542
+ FOUNDATION_EXPORT NSCalendarIdentifier const NSCalendarIdentifierRepublicOfChina API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
2543
+ FOUNDATION_EXPORT NSCalendarIdentifier const NSCalendarIdentifierTamil API_AVAILABLE(macos(26.0), ios(26.0), watchos(26.0), tvos(26.0), visionos(26.0));
2544
+ FOUNDATION_EXPORT NSCalendarIdentifier const NSCalendarIdentifierTelugu API_AVAILABLE(macos(26.0), ios(26.0), watchos(26.0), tvos(26.0), visionos(26.0));
2545
+ FOUNDATION_EXPORT NSCalendarIdentifier const NSCalendarIdentifierVietnamese API_AVAILABLE(macos(26.0), ios(26.0), watchos(26.0), tvos(26.0), visionos(26.0));
2546
+ FOUNDATION_EXPORT NSCalendarIdentifier const NSCalendarIdentifierVikram API_AVAILABLE(macos(26.0), ios(26.0), watchos(26.0), tvos(26.0), visionos(26.0));
2000
2547
  __attribute__((swift_bridge("Calendar")))
2001
2548
  @interface NSCalendar : NSObject <NSCopying, NSSecureCoding>
2002
2549
  - (nullable id)initWithCalendarIdentifier:(NSCalendarIdentifier)ident NS_DESIGNATED_INITIALIZER;
@@ -2141,11 +2688,15 @@ NS_SWIFT_NAME(Bundle)
2141
2688
  @property (nullable, readonly, copy) NSURL *appStoreReceiptURL __attribute__((availability(macos,introduced=10.7), availability(ios,introduced=7.0), availability(watchos,introduced=2.0), availability(tvos,introduced=9.0)));
2142
2689
  #endif
2143
2690
  @property (readonly, copy) NSString *bundlePath;
2691
+ @property (readonly, copy) NSURL *bundleURL __attribute__((availability(macos,introduced=10.6), availability(ios,introduced=4.0), availability(watchos,introduced=2.0), availability(tvos,introduced=9.0)));
2692
+ @property (nullable, readonly, copy) NSURL *resourceURL __attribute__((availability(macos,introduced=10.6), availability(ios,introduced=4.0), availability(watchos,introduced=2.0), availability(tvos,introduced=9.0)));
2144
2693
  @property (nullable, readonly, copy) NSString *executablePath;
2145
2694
  @property (nullable, readonly, copy) NSDictionary<NSString *, id> *infoDictionary;
2146
2695
  @property (class, readonly, strong) NSBundle *mainBundle;
2147
2696
  - (nullable NSURL *)URLForResource:(nullable NSString *)name withExtension:(nullable NSString *)ext __attribute__((availability(macos,introduced=10.6), availability(ios,introduced=4.0), availability(watchos,introduced=2.0), availability(tvos,introduced=9.0)));
2697
+ + (nullable instancetype)bundleWithPath:(NSString *)path;
2148
2698
  - (nullable instancetype)initWithURL:(NSURL *)url __attribute__((availability(macos,introduced=10.6), availability(ios,introduced=4.0), availability(watchos,introduced=2.0), availability(tvos,introduced=9.0)));
2699
+ + (nullable instancetype)bundleWithURL:(NSURL *)url __attribute__((availability(macos,introduced=10.6), availability(ios,introduced=4.0), availability(watchos,introduced=2.0), availability(tvos,introduced=9.0)));
2149
2700
  + (NSBundle *)bundleForClass:(Class)aClass;
2150
2701
  @property (nullable, readonly, copy) NSString *bundleIdentifier;
2151
2702
  - (NSString *)localizedStringForKey:(NSString *)key value:(nullable NSString *)value table:(nullable NSString *)tableName NS_FORMAT_ARGUMENT(1);
@@ -2526,8 +3077,18 @@ NS_SWIFT_NAME(FileHandle)
2526
3077
  - (void)synchronizeFile __attribute__((availability(ios,introduced=2.0,deprecated=100000,replacement="synchronizeAndReturnError:")));
2527
3078
  - (void)closeFile __attribute__((availability(ios,introduced=2.0,deprecated=100000,replacement="closeAndReturnError:")));
2528
3079
  @end
3080
+ typedef struct NS_SWIFT_SENDABLE {
3081
+ /// The major release number, such as 10 in version 10.9.3.
3082
+ NSInteger majorVersion;
3083
+ /// The minor release number, such as 9 in version 10.9.3.
3084
+ NSInteger minorVersion;
3085
+ /// The update release number, such as 3 in version 10.9.3.
3086
+ NSInteger patchVersion;
3087
+ } NSOperatingSystemVersion NS_SWIFT_NAME(OperatingSystemVersion);
2529
3088
  NS_SWIFT_NAME(ProcessInfo)
2530
3089
  @interface NSProcessInfo : NSObject
3090
+ @property (readonly, copy) NSArray<NSString *> *arguments;
3091
+ @property (readonly) NSTimeInterval systemUptime API_AVAILABLE(macos(10.6), ios(4.0), watchos(2.0), tvos(9.0));
2531
3092
  @property (readonly, copy) NSString *globallyUniqueString;
2532
3093
  @property (readonly) NSUInteger activeProcessorCount __attribute__((availability(macos,introduced=10.5), availability(ios,introduced=2.0), availability(watchos,introduced=2.0), availability(tvos,introduced=9.0)));
2533
3094
  @property (readonly) unsigned long long physicalMemory __attribute__((availability(macos,introduced=10.5), availability(ios,introduced=2.0), availability(watchos,introduced=2.0), availability(tvos,introduced=9.0)));
@@ -2537,6 +3098,10 @@ NS_SWIFT_NAME(ProcessInfo)
2537
3098
  @property (readonly, copy) NSDictionary<NSString *, NSString *> *environment;
2538
3099
  @property (readonly) NSUInteger processorCount __attribute__((availability(ios,introduced=2.0)));
2539
3100
  @end
3101
+ @interface NSProcessInfo (NSProcessInfoVersion)
3102
+ @property (readonly) NSOperatingSystemVersion operatingSystemVersion API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));
3103
+ - (BOOL) isOperatingSystemAtLeastVersion:(NSOperatingSystemVersion)version API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));
3104
+ @end
2540
3105
  @interface NSProcessInfo (NSProcessInfoPlatform)
2541
3106
  @property (readonly, getter=isiOSAppOnMac) BOOL iOSAppOnMac __attribute__((availability(macos,introduced=11.0), availability(ios,introduced=14.0), availability(watchos,introduced=7.0), availability(tvos,introduced=14.0)));
2542
3107
  @end
@@ -2995,6 +3560,25 @@ NS_SWIFT_NAME(InputStream)
2995
3560
  NS_SWIFT_NAME(OutputStream)
2996
3561
  @interface NSOutputStream : NSStream
2997
3562
  @end
3563
+ typedef NS_OPTIONS(NSUInteger, NSStreamEvent) {
3564
+ NSStreamEventNone = 0,
3565
+ NSStreamEventOpenCompleted = 1UL << 0,
3566
+ NSStreamEventHasBytesAvailable = 1UL << 1,
3567
+ NSStreamEventHasSpaceAvailable = 1UL << 2,
3568
+ NSStreamEventErrorOccurred = 1UL << 3,
3569
+ NSStreamEventEndEncountered = 1UL << 4
3570
+ };
3571
+ @protocol NSStreamDelegate <NSObject>
3572
+ @optional
3573
+ - (void)stream:(NSStream *)aStream handleEvent:(NSStreamEvent)eventCode;
3574
+ @end
3575
+ typedef NS_ENUM(NSUInteger, NSDateFormatterStyle) {
3576
+ NSDateFormatterNoStyle = 0,
3577
+ NSDateFormatterShortStyle = 1,
3578
+ NSDateFormatterMediumStyle = 2,
3579
+ NSDateFormatterLongStyle = 3,
3580
+ NSDateFormatterFullStyle = 4
3581
+ };
2998
3582
  typedef NS_ENUM(NSUInteger, NSDateFormatterBehavior) { NSDateFormatterBehaviorDefault = 0, NSDateFormatterBehavior10_4 = 1040 };
2999
3583
  NS_SWIFT_NAME(Formatter)
3000
3584
  @interface NSFormatter : NSObject <NSCopying, NSCoding>
@@ -3003,11 +3587,57 @@ NS_SWIFT_NAME(DateFormatter)
3003
3587
  @interface NSDateFormatter : NSFormatter
3004
3588
  @property NSDateFormatterBehavior formatterBehavior;
3005
3589
  @property (null_resettable, copy) NSString *dateFormat;
3590
+ @property NSDateFormatterStyle dateStyle;
3591
+ @property NSDateFormatterStyle timeStyle;
3006
3592
  @property (null_resettable, copy) NSLocale *locale;
3007
3593
  @property (null_resettable, copy) NSTimeZone *timeZone;
3008
3594
  - (NSString *)stringFromDate:(NSDate *)date;
3009
3595
  - (nullable NSDate *)dateFromString:(NSString *)string;
3010
3596
  @end
3597
+ typedef NS_ENUM(NSInteger, NSFormattingUnitStyle) {
3598
+ NSFormattingUnitStyleShort = 1,
3599
+ NSFormattingUnitStyleMedium,
3600
+ NSFormattingUnitStyleLong,
3601
+ } API_AVAILABLE(macos(10.12), ios(10.0), watchos(3.0), tvos(10.0));
3602
+ typedef NS_OPTIONS(NSUInteger, NSMeasurementFormatterUnitOptions) {
3603
+ NSMeasurementFormatterUnitOptionsProvidedUnit = (1UL << 0),
3604
+ NSMeasurementFormatterUnitOptionsNaturalScale = (1UL << 1),
3605
+ NSMeasurementFormatterUnitOptionsTemperatureWithoutUnit = (1UL << 2),
3606
+ } API_AVAILABLE(macos(10.12), ios(10.0), watchos(3.0), tvos(10.0));
3607
+ NS_SWIFT_SENDABLE
3608
+ API_AVAILABLE(macos(10.12), ios(10.0), watchos(3.0), tvos(10.0))
3609
+ @interface NSUnit : NSObject <NSCopying, NSSecureCoding>
3610
+ @property (readonly, copy) NSString *symbol;
3611
+ + (instancetype)new NS_UNAVAILABLE;
3612
+ - (instancetype)init NS_UNAVAILABLE;
3613
+ - (instancetype)initWithSymbol:(NSString *)symbol NS_DESIGNATED_INITIALIZER;
3614
+ @end
3615
+ NS_SWIFT_SENDABLE
3616
+ API_AVAILABLE(macos(10.12), ios(10.0), watchos(3.0), tvos(10.0))
3617
+ @interface NSDimension : NSUnit <NSSecureCoding>
3618
+ @end
3619
+ NS_SWIFT_SENDABLE
3620
+ API_AVAILABLE(macos(10.12), ios(10.0), watchos(3.0), tvos(10.0))
3621
+ @interface NSUnitTemperature : NSDimension
3622
+ @property (class, readonly, copy) NSUnitTemperature *kelvin;
3623
+ @property (class, readonly, copy) NSUnitTemperature *celsius;
3624
+ @property (class, readonly, copy) NSUnitTemperature *fahrenheit;
3625
+ @end
3626
+ NS_SWIFT_SENDABLE
3627
+ API_AVAILABLE(macos(10.12), ios(10.0), watchos(3.0), tvos(10.0))
3628
+ @interface NSMeasurement<__covariant UnitType : NSUnit *> : NSObject <NSCopying, NSSecureCoding>
3629
+ @property (readonly, copy) UnitType unit;
3630
+ @property (readonly) double doubleValue;
3631
+ - (instancetype)init NS_UNAVAILABLE;
3632
+ - (instancetype)initWithDoubleValue:(double)doubleValue unit:(UnitType)unit NS_DESIGNATED_INITIALIZER;
3633
+ @end
3634
+ API_AVAILABLE(macos(10.12), ios(10.0), watchos(3.0), tvos(10.0))
3635
+ @interface NSMeasurementFormatter : NSFormatter <NSSecureCoding>
3636
+ @property NSMeasurementFormatterUnitOptions unitOptions;
3637
+ @property NSFormattingUnitStyle unitStyle;
3638
+ @property (null_resettable, copy) NSLocale *locale;
3639
+ - (NSString *)stringFromMeasurement:(NSMeasurement *)measurement;
3640
+ @end
3011
3641
  NS_SWIFT_NAME(NumberFormatter)
3012
3642
  @interface NSNumberFormatter : NSObject
3013
3643
  @end
@@ -3086,13 +3716,16 @@ __attribute__((availability(ios,introduced=6.0)))
3086
3716
  - (void)cache:(NSCache *)cache willEvictObject:(id)obj;
3087
3717
  @end
3088
3718
  @interface NSCache<KeyType, ObjectType> : NSObject
3719
+ @property (copy) NSString *name;
3720
+ @property (nullable, assign) id<NSCacheDelegate> delegate;
3721
+ - (nullable ObjectType)objectForKey:(KeyType)key;
3722
+ - (void)setObject:(ObjectType)obj forKey:(KeyType)key;
3089
3723
  - (void)setObject:(ObjectType)obj forKey:(KeyType)key cost:(NSUInteger)g;
3090
- - (void)removeAllObjects;
3091
3724
  - (void)removeObjectForKey:(KeyType)key;
3092
- - (nullable ObjectType)objectForKey:(KeyType)key;
3725
+ - (void)removeAllObjects;
3093
3726
  @property NSUInteger totalCostLimit;
3094
3727
  @property NSUInteger countLimit;
3095
- @property (nullable, assign) id<NSCacheDelegate> delegate;
3728
+ @property BOOL evictsObjectsWithDiscardedContent;
3096
3729
  @end
3097
3730
  @interface NSMapTable<KeyType, ObjectType> : NSObject <NSCopying, NSSecureCoding, NSFastEnumeration>
3098
3731
  - (void)removeAllObjects;
@@ -3144,6 +3777,7 @@ FOUNDATION_EXPORT NSString *NSStringFromSelector(SEL aSelector);
3144
3777
  FOUNDATION_EXPORT SEL NSSelectorFromString(NSString *aSelectorName);
3145
3778
  FOUNDATION_EXPORT NSString *NSStringFromClass(Class aClass);
3146
3779
  FOUNDATION_EXPORT void NSLog(NSString *format, ...) NS_FORMAT_FUNCTION(1,2) NS_SWIFT_UNAVAILABLE("Use print or os_log");
3780
+ FOUNDATION_EXPORT void NSLogv(NSString *format, va_list args) NS_FORMAT_FUNCTION(1,0) NS_SWIFT_UNAVAILABLE("Use print or os_log");
3147
3781
  #define NSLocalizedStringFromTableInBundle(key, tbl, bundle, comment) [bundle localizedStringForKey:(key) value:@"" table:(tbl)]
3148
3782
  FOUNDATION_EXPORT NSLocaleKey const NSLocaleCountryCode;
3149
3783
  FOUNDATION_EXPORT NSLocaleKey const NSLocaleLanguageCode;
@@ -3208,14 +3842,6 @@ typedef NS_OPTIONS(NSUInteger, NSMatchingFlags) {
3208
3842
  + (nullable NSRegularExpression *)regularExpressionWithPattern:(NSString *)pattern options:(NSRegularExpressionOptions)options error:(NSError **)error;
3209
3843
  - (void)enumerateMatchesInString:(NSString *)string options:(NSMatchingOptions)options range:(NSRange)range usingBlock:(void (NS_NOESCAPE ^)(NSTextCheckingResult * _Nullable result, NSMatchingFlags flags, BOOL *stop))block;
3210
3844
  @end
3211
- typedef struct NS_SWIFT_SENDABLE {
3212
- /// The major release number, such as 10 in version 10.9.3.
3213
- NSInteger majorVersion;
3214
- /// The minor release number, such as 9 in version 10.9.3.
3215
- NSInteger minorVersion;
3216
- /// The update release number, such as 3 in version 10.9.3.
3217
- NSInteger patchVersion;
3218
- } NSOperatingSystemVersion NS_SWIFT_NAME(OperatingSystemVersion);
3219
3845
  @interface NSComparisonPredicate : NSPredicate
3220
3846
  @end
3221
3847
  NS_SWIFT_NAME(LengthFormatter)
@@ -3320,10 +3946,43 @@ NS_ROOT_CLASS
3320
3946
  @interface NSBlockOperation : NSOperation
3321
3947
  + (instancetype)blockOperationWithBlock:(void (NS_SWIFT_SENDABLE ^)(void))block;
3322
3948
  @end
3949
+ NS_ASSUME_NONNULL_BEGIN
3950
+ typedef NS_ENUM(NSUInteger, NSURLCacheStoragePolicy)
3951
+ {
3952
+ NSURLCacheStorageAllowed,
3953
+ NSURLCacheStorageAllowedInMemoryOnly,
3954
+ NSURLCacheStorageNotAllowed,
3955
+ };
3956
+ NS_SWIFT_SENDABLE
3957
+ @interface NSCachedURLResponse : NSObject <NSSecureCoding, NSCopying>
3958
+ - (instancetype)initWithResponse:(NSURLResponse *)response data:(NSData *)data;
3959
+ - (instancetype)initWithResponse:(NSURLResponse *)response data:(NSData *)data userInfo:(nullable NSDictionary *)userInfo storagePolicy:(NSURLCacheStoragePolicy)storagePolicy;
3960
+ @property (readonly, copy) NSURLResponse *response;
3961
+ @property (readonly, copy) NSData *data;
3962
+ @property (nullable, readonly, copy) NSDictionary *userInfo;
3963
+ @property (readonly) NSURLCacheStoragePolicy storagePolicy;
3964
+ @end
3965
+ NS_SWIFT_SENDABLE
3323
3966
  @interface NSURLCache : NSObject
3324
- - (nullable NSCachedURLResponse *)cachedResponseForRequest:(NSURLRequest *)request;
3325
3967
  @property (class, strong) NSURLCache *sharedURLCache;
3968
+ - (instancetype)initWithMemoryCapacity:(NSUInteger)memoryCapacity diskCapacity:(NSUInteger)diskCapacity diskPath:(nullable NSString *)path API_DEPRECATED_WITH_REPLACEMENT("initWithMemoryCapacity:diskCapacity:directoryURL:", macos(10.2, API_TO_BE_DEPRECATED), ios(2.0, API_TO_BE_DEPRECATED), watchos(2.0, API_TO_BE_DEPRECATED), tvos(9.0, API_TO_BE_DEPRECATED));
3969
+ - (instancetype)initWithMemoryCapacity:(NSUInteger)memoryCapacity diskCapacity:(NSUInteger)diskCapacity directoryURL:(nullable NSURL *)directoryURL API_AVAILABLE(macos(10.15), ios(13.0), watchos(6.0), tvos(13.0));
3970
+ - (nullable NSCachedURLResponse *)cachedResponseForRequest:(NSURLRequest *)request;
3971
+ - (void)storeCachedResponse:(NSCachedURLResponse *)cachedResponse forRequest:(NSURLRequest *)request;
3972
+ - (void)removeCachedResponseForRequest:(NSURLRequest *)request;
3973
+ - (void)removeAllCachedResponses;
3974
+ - (void)removeCachedResponsesSinceDate:(NSDate *)date API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));
3975
+ @property NSUInteger memoryCapacity;
3976
+ @property NSUInteger diskCapacity;
3977
+ @property (readonly) NSUInteger currentMemoryUsage;
3978
+ @property (readonly) NSUInteger currentDiskUsage;
3979
+ @end
3980
+ @interface NSURLCache (NSURLSessionTaskAdditions)
3981
+ - (void)storeCachedResponse:(NSCachedURLResponse *)cachedResponse forDataTask:(NSURLSessionDataTask *)dataTask API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));
3982
+ - (void)getCachedResponseForDataTask:(NSURLSessionDataTask *)dataTask completionHandler:(void (NS_SWIFT_SENDABLE ^) (NSCachedURLResponse * _Nullable cachedResponse))completionHandler API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));
3983
+ - (void)removeCachedResponseForDataTask:(NSURLSessionDataTask *)dataTask API_AVAILABLE(macos(10.10), ios(8.0), watchos(2.0), tvos(9.0));
3326
3984
  @end
3985
+ NS_ASSUME_NONNULL_END
3327
3986
  FOUNDATION_EXPORT const float NSURLSessionTaskPriorityDefault __attribute__((availability(macos,introduced=10.10), availability(ios,introduced=8.0), availability(watchos,introduced=2.0), availability(tvos,introduced=9.0)));
3328
3987
  FOUNDATION_EXPORT const float NSURLSessionTaskPriorityLow __attribute__((availability(macos,introduced=10.10), availability(ios,introduced=8.0), availability(watchos,introduced=2.0), availability(tvos,introduced=9.0)));
3329
3988
  FOUNDATION_EXPORT const float NSURLSessionTaskPriorityHigh __attribute__((availability(macos,introduced=10.10), availability(ios,introduced=8.0), availability(watchos,introduced=2.0), availability(tvos,introduced=9.0)));
@@ -3333,10 +3992,16 @@ FOUNDATION_EXPORT NSString * const NSKeyedArchiveRootObjectKey __attribute__((av
3333
3992
  FOUNDATION_EXPORT NSURLResourceKey const NSURLFileSizeKey __attribute__((availability(macos,introduced=10.6), availability(ios,introduced=4.0), availability(watchos,introduced=2.0), availability(tvos,introduced=9.0)));
3334
3993
  FOUNDATION_EXPORT NSURLResourceKey const NSURLTotalFileAllocatedSizeKey __attribute__((availability(macos,introduced=10.7), availability(ios,introduced=5.0), availability(watchos,introduced=2.0), availability(tvos,introduced=9.0)));
3335
3994
  #define NSURLResponseUnknownLength ((long long)-1)
3336
- @interface NSCachedURLResponse : NSObject <NSSecureCoding, NSCopying>
3337
- @property (readonly, copy) NSURLResponse *response;
3338
- @property (readonly, copy) NSData *data;
3339
- @end
3995
+ #if TARGET_OS_IPHONE
3996
+ #if __has_include(<CFNetwork/CFNetwork.h>)
3997
+ #ifndef __swift__
3998
+ // the swift CFNetwork module imports Foundation; keep this edge for C/ObjC.
3999
+ #import <CFNetwork/CFNetwork.h>
4000
+ #endif
4001
+ #endif
4002
+ #else
4003
+ #import <CoreServices/CoreServices.h>
4004
+ #endif
3340
4005
  FOUNDATION_EXPORT NSErrorDomain const NSURLErrorDomain;
3341
4006
  NS_ERROR_ENUM(NSURLErrorDomain)
3342
4007
  {