peachsim 0.1.1738 → 0.1.1744
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.
- package/README.md +4 -0
- package/cli/app-catalog.ts +47 -23
- package/cli/app-fonts.ts +19 -1
- package/cli/command-registry.ts +3 -0
- package/cli/commands/control.ts +67 -16
- package/cli/commands/device.ts +3 -1
- package/cli/commands/doctor.ts +1 -4
- package/cli/commands/inspect/settling.ts +6 -1
- package/cli/commands/inspect/wait-ready.ts +22 -2
- package/cli/commands/package.ts +22 -20
- package/cli/commands/push.ts +56 -0
- package/cli/commands/serve.ts +9 -0
- package/cli/commands/shell-url.ts +37 -9
- package/cli/commands/swift.ts +1 -1
- package/cli/current-sim.ts +27 -0
- package/cli/drivers/linux-browser-libs.lock.json +323 -1
- package/cli/drivers/linux-browser-libs.ts +8 -6
- package/cli/drivers/playwright.ts +5 -1
- package/cli/internal-child.ts +11 -1
- package/cli/main.ts +6 -0
- package/cli/native-input.ts +1 -7
- package/cli/outbound-endpoints.ts +9 -1
- package/cli/packaged-app-launcher.ts +3 -1
- package/cli/scene-video.ts +4 -0
- package/cli/ws-bridge.ts +3 -1
- package/detox/index.ts +9 -4
- package/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/attached-projects.cjs +1 -1
- package/dist-lib/auth/shared-session.cjs +1 -1
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +1 -1
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/bridge-contract-input.cjs +1 -1
- package/dist-lib/bridge-contract-input.mjs +1 -1
- package/dist-lib/bridge-contract.cjs +1 -1
- package/dist-lib/bridge-contract.mjs +1 -1
- package/dist-lib/bundle-channel.cjs +7372 -3675
- package/dist-lib/capture-contract.cjs +1 -1
- package/dist-lib/capture-contract.mjs +1 -1
- package/dist-lib/cloud-contract.cjs +1 -1
- package/dist-lib/cloud-contract.mjs +1 -1
- package/dist-lib/cloud-test-args.cjs +1 -1
- package/dist-lib/cloud-test-args.mjs +1 -1
- package/dist-lib/cloud.cjs +1 -1
- package/dist-lib/cloud.mjs +1 -1
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/config.mjs +1 -1
- package/dist-lib/detox/index.cjs +22 -8
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/expo-swift-bundle.cjs +6340 -3064
- package/dist-lib/expo-swift-metadata.cjs +14 -2
- package/dist-lib/expo-swift-metadata.mjs +14 -2
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +6524 -2720
- package/dist-lib/host/fetch-proxy-handler.cjs +8 -7
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
- package/dist-lib/host/replacement-module-handler.cjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +6 -3
- package/dist-lib/index.cjs +97 -31
- package/dist-lib/jump-to-source-babel.cjs +1 -1
- package/dist-lib/jump-to-source-native.cjs +1 -1
- package/dist-lib/kotlin-host.cjs +1 -1
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +1 -1
- package/dist-lib/metro-fingerprint-registry.cjs +1 -1
- package/dist-lib/metro-fingerprint-registry.mjs +1 -1
- package/dist-lib/metro-production-bundle.cjs +1 -1
- package/dist-lib/metro-production-bundle.mjs +1 -1
- package/dist-lib/metro.cjs +71 -29
- package/dist-lib/native-app-identity-project.cjs +53 -22
- package/dist-lib/native-app-identity-project.mjs +53 -22
- package/dist-lib/native-app-identity.cjs +10 -3
- package/dist-lib/native-app-identity.mjs +10 -3
- package/dist-lib/native-firebase-metadata.cjs +1 -1
- package/dist-lib/native-firebase-metadata.mjs +1 -1
- package/dist-lib/plist.cjs +1 -1
- package/dist-lib/plist.mjs +1 -1
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/public-brand.cjs +1 -1
- package/dist-lib/public-origins-lib-esm.json +25 -23
- package/dist-lib/public-origins-lib.json +111 -79
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +1 -1
- package/dist-lib/reap-browser.cjs +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/sdk.cjs +4 -1
- package/dist-lib/sdk.mjs +4 -1
- package/dist-lib/skills.cjs +40549 -37613
- package/dist-lib/swift-compile.cjs +2054 -388
- package/dist-lib/swift-compile.mjs +1976 -312
- package/dist-lib/swift-package.cjs +1 -1
- package/dist-lib/swift-package.mjs +1 -1
- package/dist-lib/swift-submit.cjs +2 -2
- package/dist-lib/swift-submit.mjs +2 -2
- package/dist-lib/swift-toolchain.cjs +68 -8
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vite-swift.cjs +5867 -2646
- package/dist-lib/vite.cjs +18 -8
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/dist-types/packages/peach-compat/src/stubs/screen-transition-math.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/cli-companion.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/engine/canvaskit-renderer.d.ts +2 -0
- package/dist-types/packages/peach-engine/src/engine/image-loader.d.ts +0 -3
- package/dist-types/packages/peach-engine/src/engine/node.d.ts +6 -0
- package/dist-types/packages/peach-engine/src/engine/paint-boundary.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/engine/scene-table.d.ts +25 -3
- package/dist-types/packages/peach-engine/src/engine/scroll-platform.d.ts +1 -15
- package/dist-types/packages/peach-engine/src/engine/scroll.d.ts +1 -3
- package/dist-types/packages/peach-engine/src/engine/text-first-baseline.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/engine/types.d.ts +23 -0
- package/dist-types/packages/peach-engine/src/ios/chrome-metrics.d.ts +6 -0
- package/dist-types/packages/peach-engine/src/metro-identity-contract.d.ts +33 -0
- package/dist-types/packages/peach-engine/src/preview/bundle-layout.d.ts +1 -1
- package/dist-types/packages/peach-engine/src/remote-stream/scene-recording.d.ts +2 -0
- package/dist-types/packages/peach-engine/src/render-worker/compositor-gpu.d.ts +1 -1
- package/dist-types/packages/peach-engine/src/render-worker/compositor-protocol.d.ts +2 -0
- package/dist-types/packages/peach-engine/src/render-worker/metro-bundle-metadata.d.ts +28 -0
- package/dist-types/packages/peach-engine/src/render-worker/native-ui-protocol.d.ts +21 -1
- package/dist-types/packages/peach-engine/src/render-worker/prepared-boot-bundle.d.ts +7 -0
- package/dist-types/packages/peach-engine/src/render-worker/protocol.d.ts +8 -0
- package/dist-types/packages/peach-engine/src/render-worker/scroll-mirror.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/render-worker/shell-protocol.d.ts +5 -0
- package/dist-types/packages/peach-engine/src/render-worker/test-bridge-protocol.d.ts +3 -3
- package/dist-types/packages/peach-engine/src/render-worker/webgpu-frame-transaction.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/render-worker/webgpu-readback-scheduler.d.ts +1 -1
- package/dist-types/packages/peach-engine/src/render-worker/worklet-runtime.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/rolldown-bundle-inventory.d.ts +8 -1
- package/dist-types/packages/peach-engine/src/rolldown-production-fingerprint.d.ts +1 -4
- package/dist-types/packages/peach-engine/src/rolldown-production-module.d.ts +12 -0
- package/dist-types/packages/peach-engine/src/rolldown-production-roles.d.ts +6 -0
- package/dist-types/packages/peach-engine/src/settings/devices.d.ts +6 -1
- package/dist-types/packages/peach-engine/src/settings/duo-fold-bus.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/shell-events.d.ts +4 -0
- package/dist-types/packages/peach-kit/src/capabilities.d.ts +7 -0
- package/package.json +2 -1
- package/runtime-companion.json +1 -1
- package/sdk/ios/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetwork.h +1 -0
- package/sdk/ios/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetworkErrors.h +257 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFByteOrder.h +305 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h +2 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGAffineTransform.h +204 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGBitmapContext.h +260 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGColor.h +164 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGColorConversionInfo.h +101 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGColorSpace.h +510 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGContext.h +1132 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGConvertColorDataWithFormat.h +34 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDataConsumer.h +83 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDataProvider.h +197 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGEXRToneMappingGamma.h +36 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGError.h +38 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGFont.h +312 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGFunction.h +106 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGGradient.h +123 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGITUToneMapping.h +31 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGImage.h +409 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGLayer.h +78 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFArray.h +120 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFContentStream.h +55 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFContext.h +535 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFDictionary.h +133 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFDocument.h +252 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFMarkedContentItem.h +37 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFObject.h +67 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFOperatorTable.h +51 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFPage.h +101 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFScanner.h +123 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFStream.h +44 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFString.h +52 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPDFStructureElement.h +87 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPath.h +441 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGPattern.h +89 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGRenderingBufferProvider.h +49 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGShading.h +124 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CGToneMapping.h +85 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.h +44 -252
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Modules/module.modulemap +1 -0
- package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/CFNetworkErrors.h +257 -0
- package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes +0 -6
- package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h +356 -61
- package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/NSURLSession+Network.h +32 -0
- package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/Network.h +51 -0
- package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/advertise_descriptor.h +193 -0
- package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/browse_descriptor.h +163 -0
- package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/browse_result.h +207 -0
- package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/browser.h +285 -0
- package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/connection.h +714 -0
- package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/connection_group.h +629 -0
- package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/connection_report.h +932 -0
- package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/content_context.h +229 -0
- package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/endpoint.h +390 -0
- package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/error.h +135 -0
- package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/ethernet_channel.h +349 -0
- package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/framer_options.h +1187 -0
- package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/group_descriptor.h +184 -0
- package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/interface.h +150 -0
- package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/ip_options.h +351 -0
- package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/listener.h +438 -0
- package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/nw_object.h +200 -0
- package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/parameters.h +1205 -0
- package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/path.h +392 -0
- package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/path_monitor.h +216 -0
- package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/privacy_context.h +188 -0
- package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/protocol_options.h +126 -0
- package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/proxy_config.h +357 -0
- package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/quic_options.h +889 -0
- package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/resolver_config.h +94 -0
- package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/tcp_options.h +459 -0
- package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/tls_options.h +115 -0
- package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/txt_record.h +432 -0
- package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/udp_options.h +112 -0
- package/sdk/ios/System/Library/Frameworks/Network.framework/Headers/ws_options.h +743 -0
- package/sdk/ios/System/Library/Frameworks/Network.framework/Modules/module.modulemap +9 -0
- package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CAAnimation.h +395 -0
- package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CABase.h +132 -0
- package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CADisplayLink.h +107 -0
- package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CAEmitterCell.h +153 -0
- package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CAEmitterLayer.h +151 -0
- package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CAFrameRateRange.h +40 -0
- package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CAGradientLayer.h +78 -0
- package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CALayer.h +1078 -0
- package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CAMediaTiming.h +97 -0
- package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CAMediaTimingFunction.h +67 -0
- package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CAReplicatorLayer.h +65 -0
- package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CAScrollLayer.h +64 -0
- package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CAShapeLayer.h +135 -0
- package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CATextLayer.h +99 -0
- package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CATiledLayer.h +67 -0
- package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CATransaction.h +124 -0
- package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CATransform3D.h +138 -0
- package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CATransformLayer.h +40 -0
- package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/CAValueFunction.h +78 -0
- package/sdk/ios/System/Library/Frameworks/QuartzCore.framework/Headers/QuartzCore.h +19 -38
- package/sdk/ios/System/Library/Frameworks/Security.framework/Headers/SecureTransport.h +1757 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/NSAttributedString.h +19 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/NSParagraphStyle.h +28 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibilityConstants.h +114 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h +16 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIBarAppearance.h +47 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIDataDetectors.h +20 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIDatePicker.h +13 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIDevice.h +16 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIEvent.h +84 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIGestureRecognizer.h +119 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIGestureRecognizerSubclass.h +66 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIHoverGestureRecognizer.h +45 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h +161 -37
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIPickerView.h +76 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UITabBar.h +8 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UITabBarAppearance.h +78 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UITextInputTraits.h +29 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UITouch.h +104 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UITraitCollection.h +19 -0
- package/sdk/ios/usr/include/dns_sd.h +3616 -0
- package/sdk/ios/usr/include/dnssd.modulemap +4 -0
- package/sdk/ios/usr/include/module.modulemap +1 -0
- package/sdk/ios/usr/include/sys/socketvar.h +191 -0
- package/sdk/ios/usr/include/sys/vsock.h +84 -0
- package/sdk/native-hashes.json +1 -1
- package/skills/contrast/SKILL.md +6 -5
- package/skills/peach-debug/SKILL.md +68 -264
- package/skills/peach-debug/references/accessibility.md +37 -73
- package/skills/peach-debug/references/commands.md +2 -2
- package/skills/peach-debug/references/events.md +74 -0
- package/skills/peach-perf/SKILL.md +64 -401
- package/skills/peach-perf/references/presentation.md +46 -0
- package/skills/peach-perf/references/profiling.md +93 -0
- package/skills/peach-perf/references/render-counters.md +57 -0
- package/skills/peach-setup/SKILL.md +66 -216
- package/skills/peach-setup/references/native-config.md +35 -0
- package/skills/peach-setup/references/reporting.md +28 -0
- package/skills/peach-test/SKILL.md +68 -284
- package/skills/peach-test/references/detox.md +69 -0
- package/skills/peach-test/references/maestro.md +95 -0
- package/skills/peach-visual/SKILL.md +53 -105
- package/src/appPackageContract.ts +12 -1
- package/src/assetCatalogContract.ts +8 -1
- package/src/bridge-contract.ts +6 -0
- package/src/bundle-channel.mjs +133 -59
- package/src/cli-runtime.ts +8 -9
- package/src/configured-bundle-producer.ts +10 -0
- package/src/device-catalog.ts +68 -4
- package/src/expo-discovery-cache.ts +3 -0
- package/src/expo-native-workspace.ts +81 -17
- package/src/expo-swift-host.ts +57 -104
- package/src/expo-widget-assets.ts +76 -0
- package/src/expoSwiftContract.ts +13 -1
- package/src/host/websocket-proxy.ts +7 -2
- package/src/native-prebuilt.ts +3 -3
- package/src/nitro-adapter.lock.json +263 -263
- package/src/nitro-adapter.ts +69 -7
- package/src/nitro-bundle.ts +52 -24
- package/src/nitro-compile.ts +6 -1
- package/src/nitro-source.ts +82 -4
- package/src/nitro-superset.lock.json +103 -0
- package/src/nitro-superset.ts +137 -0
- package/src/nitroContract.ts +5 -1
- package/src/react-bridge-importers.ts +1 -0
- package/src/settingsContract.ts +26 -1
- package/src/swift-compile.ts +267 -68
- package/src/swift-compiler-digest.ts +2 -0
- package/src/swift-coverage/xcode-packages.ts +61 -1
- package/src/swift-coverage/xcode.ts +10 -12
- package/src/swift-cxx-reachable.ts +1 -1
- package/src/swift-distribution.lock.json +15 -13
- package/src/swift-distribution.ts +57 -26
- package/src/swift-host.ts +48 -35
- package/src/swift-link-roots.ts +45 -18
- package/src/swift-objc-compile.ts +78 -2
- package/src/swift-objc-standin.ts +3 -0
- package/src/swift-shared-sdk.ts +85 -1
- package/src/swift-standins.ts +233 -11
- package/src/swift-submit.ts +13 -1
- package/src/swift-toolchain.ts +82 -7
- package/src/swift-wasm-prune.ts +1629 -0
- package/src/turbo-bundle.ts +11 -10
- package/src/turbo-runtime.lock.json +16 -16
- package/src/vite-plugin-one.ts +12 -1
- package/src/vite-plugin.ts +82 -23
- package/src/wasm-optimize.ts +34 -0
- package/src/worker-system-chunks.ts +3 -3
- package/src/xcode-project.ts +52 -0
- package/src/xcode-target-members.ts +12 -1
|
@@ -0,0 +1,629 @@
|
|
|
1
|
+
//
|
|
2
|
+
// connection_group.h
|
|
3
|
+
// Network
|
|
4
|
+
//
|
|
5
|
+
// Copyright (c) 2019-2021 Apple Inc. All rights reserved.
|
|
6
|
+
//
|
|
7
|
+
|
|
8
|
+
#ifndef __NW_CONNECTION_GROUP_H__
|
|
9
|
+
#define __NW_CONNECTION_GROUP_H__
|
|
10
|
+
|
|
11
|
+
#ifndef __NW_INDIRECT__
|
|
12
|
+
#error "Please include <Network/Network.h> instead of this file directly."
|
|
13
|
+
#endif // __NW_INDIRECT__
|
|
14
|
+
|
|
15
|
+
#include <Network/connection.h>
|
|
16
|
+
#include <Network/error.h>
|
|
17
|
+
#include <Network/group_descriptor.h>
|
|
18
|
+
#include <Network/parameters.h>
|
|
19
|
+
|
|
20
|
+
NW_ASSUME_NONNULL_BEGIN
|
|
21
|
+
|
|
22
|
+
__BEGIN_DECLS
|
|
23
|
+
|
|
24
|
+
/*!
|
|
25
|
+
* @typedef nw_connection_group_t
|
|
26
|
+
* @abstract
|
|
27
|
+
* A Network Connection Group may be used to listen for, process, and reply to
|
|
28
|
+
* incoming messages on a network that are associated with a particular group.
|
|
29
|
+
*
|
|
30
|
+
* This type supports ARC and the -[description] method. In non-ARC files, use
|
|
31
|
+
* nw_retain() and nw_release() to retain and release the object.
|
|
32
|
+
*/
|
|
33
|
+
#ifndef NW_CONNECTION_GROUP_IMPL
|
|
34
|
+
NW_OBJECT_DECL(nw_connection_group);
|
|
35
|
+
#endif // NW_CONNECTION_GROUP_IMPL
|
|
36
|
+
|
|
37
|
+
/*!
|
|
38
|
+
* @typedef nw_connection_group_state_t
|
|
39
|
+
* @abstract
|
|
40
|
+
* Connection Group states sent by nw_connection_group_set_state_changed_handler.
|
|
41
|
+
* States progress forward and do not move backwards.
|
|
42
|
+
*/
|
|
43
|
+
typedef enum {
|
|
44
|
+
/*!
|
|
45
|
+
* @const nw_connection_group_state_invalid The state of the connection group is not valid.
|
|
46
|
+
* This state will never be delivered in the connection group's state update
|
|
47
|
+
* handler and can be treated as an unexpected value.
|
|
48
|
+
*/
|
|
49
|
+
nw_connection_group_state_invalid = 0,
|
|
50
|
+
|
|
51
|
+
/*!
|
|
52
|
+
* @const nw_connection_group_state_waiting The connection group is waiting for a usable network
|
|
53
|
+
* before being able to receive and process incoming messages.
|
|
54
|
+
*/
|
|
55
|
+
nw_connection_group_state_waiting = 1,
|
|
56
|
+
|
|
57
|
+
/*!
|
|
58
|
+
* @const nw_connection_group_state_ready The connection group is ready and able to receive and
|
|
59
|
+
* process incoming messages.
|
|
60
|
+
*/
|
|
61
|
+
nw_connection_group_state_ready = 2,
|
|
62
|
+
|
|
63
|
+
/*!
|
|
64
|
+
* @const nw_connection_group_state_failed The connection group has irrecoverably failed.
|
|
65
|
+
* You should cancel the connection group and create a new connection group object
|
|
66
|
+
* if you wish to continue processing incoming messages.
|
|
67
|
+
*/
|
|
68
|
+
nw_connection_group_state_failed = 3,
|
|
69
|
+
|
|
70
|
+
/*!
|
|
71
|
+
* @const nw_connection_group_state_cancelled The connection group has been cancelled by
|
|
72
|
+
* the user. You should create a new connection group object if you wish to continue
|
|
73
|
+
* processing incoming messages.
|
|
74
|
+
*/
|
|
75
|
+
nw_connection_group_state_cancelled = 4,
|
|
76
|
+
} nw_connection_group_state_t;
|
|
77
|
+
|
|
78
|
+
/*!
|
|
79
|
+
* @function nw_connection_group_create
|
|
80
|
+
*
|
|
81
|
+
* @abstract
|
|
82
|
+
* Creates a new connection group object to use for communication with
|
|
83
|
+
* a group descriptor using protocols described by parameters.
|
|
84
|
+
*
|
|
85
|
+
* @param group_descriptor
|
|
86
|
+
* A group descriptor. For example, a descriptor of type nw_group_type_multicast
|
|
87
|
+
* defines one or more multicast groups to automatically join.
|
|
88
|
+
*
|
|
89
|
+
* @param parameters
|
|
90
|
+
* Parameters to use for the new connection group. This includes the protocols that
|
|
91
|
+
* will be used to delineate complete messages for processing. For multicast
|
|
92
|
+
* joining, all available interfaces will be joined as prohibited or required.
|
|
93
|
+
*
|
|
94
|
+
* @result
|
|
95
|
+
* Returns an allocated nw_connection_group_t object on success.
|
|
96
|
+
* Callers are responsible for deallocating using nw_release(obj) or [obj release].
|
|
97
|
+
* These objects support ARC.
|
|
98
|
+
* Returns NULL on failure. Fails due to invalid parameters.
|
|
99
|
+
*/
|
|
100
|
+
API_AVAILABLE(macos(11.0), ios(14.0), watchos(7.0), tvos(14.0))
|
|
101
|
+
NW_RETURNS_RETAINED nw_connection_group_t
|
|
102
|
+
nw_connection_group_create(nw_group_descriptor_t group_descriptor,
|
|
103
|
+
nw_parameters_t parameters);
|
|
104
|
+
|
|
105
|
+
/*!
|
|
106
|
+
* @function nw_connection_group_copy_descriptor
|
|
107
|
+
*
|
|
108
|
+
* @abstract
|
|
109
|
+
* Gets the group descriptor with which the connection group was created.
|
|
110
|
+
*
|
|
111
|
+
* @param group
|
|
112
|
+
* The connection group to check.
|
|
113
|
+
*
|
|
114
|
+
* @result
|
|
115
|
+
* Returns the descriptor with which the connection group was created.
|
|
116
|
+
*/
|
|
117
|
+
API_AVAILABLE(macos(11.0), ios(14.0), watchos(7.0), tvos(14.0))
|
|
118
|
+
NW_RETURNS_RETAINED
|
|
119
|
+
nw_group_descriptor_t
|
|
120
|
+
nw_connection_group_copy_descriptor(nw_connection_group_t group);
|
|
121
|
+
|
|
122
|
+
/*!
|
|
123
|
+
* @function nw_connection_group_copy_parameters
|
|
124
|
+
*
|
|
125
|
+
* @abstract
|
|
126
|
+
* Returns a copy of the parameters passed to nw_connection_group_create.
|
|
127
|
+
*
|
|
128
|
+
* @param group
|
|
129
|
+
* The connection group object.
|
|
130
|
+
*
|
|
131
|
+
* @result
|
|
132
|
+
* Returns an nw_parameters_t object.
|
|
133
|
+
*/
|
|
134
|
+
API_AVAILABLE(macos(11.0), ios(14.0), watchos(7.0), tvos(14.0))
|
|
135
|
+
NW_RETURNS_RETAINED nw_parameters_t
|
|
136
|
+
nw_connection_group_copy_parameters(nw_connection_group_t group);
|
|
137
|
+
|
|
138
|
+
/*!
|
|
139
|
+
* @function nw_connection_group_set_queue
|
|
140
|
+
*
|
|
141
|
+
* @abstract
|
|
142
|
+
* Sets the client callback queue, on which blocks for events will
|
|
143
|
+
* be scheduled. This must be done before calling nw_connection_group_start().
|
|
144
|
+
*
|
|
145
|
+
* @param group
|
|
146
|
+
* The connection group object.
|
|
147
|
+
*
|
|
148
|
+
* @param queue
|
|
149
|
+
* The client's callback queue.
|
|
150
|
+
*/
|
|
151
|
+
API_AVAILABLE(macos(11.0), ios(14.0), watchos(7.0), tvos(14.0))
|
|
152
|
+
void
|
|
153
|
+
nw_connection_group_set_queue(nw_connection_group_t group,
|
|
154
|
+
dispatch_queue_t queue);
|
|
155
|
+
|
|
156
|
+
#ifdef __BLOCKS__
|
|
157
|
+
|
|
158
|
+
/*!
|
|
159
|
+
* @typedef nw_connection_group_state_changed_handler_t
|
|
160
|
+
*
|
|
161
|
+
* @abstract
|
|
162
|
+
* A block called when the connection group changes state.
|
|
163
|
+
*
|
|
164
|
+
* @param state
|
|
165
|
+
* The new state of the connection group.
|
|
166
|
+
*
|
|
167
|
+
* @param error
|
|
168
|
+
* An optional error that is associated with the new state.
|
|
169
|
+
*/
|
|
170
|
+
typedef void (^nw_connection_group_state_changed_handler_t)(nw_connection_group_state_t state,
|
|
171
|
+
_Nullable nw_error_t error);
|
|
172
|
+
|
|
173
|
+
/*!
|
|
174
|
+
* @function nw_connection_group_set_state_changed_handler
|
|
175
|
+
*
|
|
176
|
+
* @abstract
|
|
177
|
+
* Sets the state changed handler. For clients that need to perform cleanup
|
|
178
|
+
* when the connection group has been cancelled, the nw_connection_group_state_cancelled state
|
|
179
|
+
* will be delivered last. This function must not be called after starting the connection group.
|
|
180
|
+
*
|
|
181
|
+
* @param group
|
|
182
|
+
* The connection group object.
|
|
183
|
+
*
|
|
184
|
+
* @param state_changed_handler
|
|
185
|
+
* The state changed handler to call when the connection group state changes.
|
|
186
|
+
* Pass NULL to remove the event handler.
|
|
187
|
+
*/
|
|
188
|
+
API_AVAILABLE(macos(11.0), ios(14.0), watchos(7.0), tvos(14.0))
|
|
189
|
+
void
|
|
190
|
+
nw_connection_group_set_state_changed_handler(nw_connection_group_t group,
|
|
191
|
+
_Nullable nw_connection_group_state_changed_handler_t state_changed_handler);
|
|
192
|
+
|
|
193
|
+
/*!
|
|
194
|
+
* @typedef nw_connection_group_receive_handler_t
|
|
195
|
+
*
|
|
196
|
+
* @abstract
|
|
197
|
+
* A block called when a new inbound message arrives at the connection group. A client
|
|
198
|
+
* may reply to this message within the handler or it may choose to save the
|
|
199
|
+
* content context representing this message and provide a response
|
|
200
|
+
* at a later time. If an inbound context is deallocated without providing a response,
|
|
201
|
+
* the message is considered dropped and any internal state associated with the
|
|
202
|
+
* endpoint that sent that message will be removed.
|
|
203
|
+
*
|
|
204
|
+
* @param content
|
|
205
|
+
* The content associated with the body of the inbound message. If there is no
|
|
206
|
+
* body for this message `content` will be `nil`.
|
|
207
|
+
*
|
|
208
|
+
* @param context
|
|
209
|
+
* The content context representing this inbound message.
|
|
210
|
+
*
|
|
211
|
+
* @param is_complete
|
|
212
|
+
* True if the inbound message is complete and any content provided represents
|
|
213
|
+
* the entirety of the inbound message's body. If false, the inbound message context
|
|
214
|
+
* may be converted to a connection associated with this message and read
|
|
215
|
+
* the remainder of the body, or an appropriate error may be selected and sent in
|
|
216
|
+
* response.
|
|
217
|
+
*/
|
|
218
|
+
typedef void (^nw_connection_group_receive_handler_t)(_Nullable dispatch_data_t content,
|
|
219
|
+
nw_content_context_t context,
|
|
220
|
+
bool is_complete);
|
|
221
|
+
|
|
222
|
+
/*!
|
|
223
|
+
* @function nw_connection_group_set_receive_handler
|
|
224
|
+
*
|
|
225
|
+
* @abstract
|
|
226
|
+
* Sets the handler to be invoked whenever a new inbound message
|
|
227
|
+
* arrives at the connection group. This function must not be called after starting the connection group.
|
|
228
|
+
*
|
|
229
|
+
* @param group
|
|
230
|
+
* The connection group object.
|
|
231
|
+
*
|
|
232
|
+
* @param maximum_message_size
|
|
233
|
+
* The maximum message size that should be delivered as a complete message. Any
|
|
234
|
+
* inbound messages larger than this size will be delivered as a partial message and
|
|
235
|
+
* an application may convert the inbound message to an `nw_connection` to read
|
|
236
|
+
* any remaining data for that message until it is complete.
|
|
237
|
+
*
|
|
238
|
+
* @param reject_oversized_messages
|
|
239
|
+
* True if messages larger than maximum_message_size should be treated as errors
|
|
240
|
+
* and the connection group should automatically reply to such messages. False if the
|
|
241
|
+
* connection group should deliver such messages as incomplete and allow the application
|
|
242
|
+
* to inspect the message prior to accepting or rejecting it.
|
|
243
|
+
*
|
|
244
|
+
* @param receive_handler
|
|
245
|
+
* The handler to call upon arrival of a new inbound message.
|
|
246
|
+
* Pass NULL to remove the handler.
|
|
247
|
+
*/
|
|
248
|
+
API_AVAILABLE(macos(11.0), ios(14.0), watchos(7.0), tvos(14.0))
|
|
249
|
+
void
|
|
250
|
+
nw_connection_group_set_receive_handler(nw_connection_group_t group,
|
|
251
|
+
uint32_t maximum_message_size,
|
|
252
|
+
bool reject_oversized_messages,
|
|
253
|
+
_Nullable nw_connection_group_receive_handler_t receive_handler);
|
|
254
|
+
|
|
255
|
+
#endif // __BLOCKS__
|
|
256
|
+
|
|
257
|
+
/*!
|
|
258
|
+
* @function nw_connection_group_start
|
|
259
|
+
*
|
|
260
|
+
* @abstract
|
|
261
|
+
* Starts the connection group, which begins listening for and processing incoming messages.
|
|
262
|
+
* You must call nw_connection_group_set_queue() and set a receive handler with
|
|
263
|
+
* nw_connection_group_set_receive_handler() before starting the connection group.
|
|
264
|
+
*
|
|
265
|
+
* @param group
|
|
266
|
+
* The connection group object.
|
|
267
|
+
*/
|
|
268
|
+
API_AVAILABLE(macos(11.0), ios(14.0), watchos(7.0), tvos(14.0))
|
|
269
|
+
void
|
|
270
|
+
nw_connection_group_start(nw_connection_group_t group);
|
|
271
|
+
|
|
272
|
+
/*!
|
|
273
|
+
* @function nw_connection_group_cancel
|
|
274
|
+
*
|
|
275
|
+
* @abstract
|
|
276
|
+
* Cancels the connection group. The process of cancellation will be completed
|
|
277
|
+
* asynchronously, and the final callback event delivered to the caller
|
|
278
|
+
* will be a state update with a value of nw_connection_group_state_cancelled.
|
|
279
|
+
* Once this update is delivered, the caller may clean up any associated
|
|
280
|
+
* memory or objects.
|
|
281
|
+
*
|
|
282
|
+
* @param group
|
|
283
|
+
* The connection group object.
|
|
284
|
+
*/
|
|
285
|
+
API_AVAILABLE(macos(11.0), ios(14.0), watchos(7.0), tvos(14.0))
|
|
286
|
+
void
|
|
287
|
+
nw_connection_group_cancel(nw_connection_group_t group);
|
|
288
|
+
|
|
289
|
+
/*!
|
|
290
|
+
* @function nw_connection_group_copy_remote_endpoint_for_message
|
|
291
|
+
*
|
|
292
|
+
* @abstract
|
|
293
|
+
* Copy the remote endpoint corresponding to a given inbound connection group message.
|
|
294
|
+
*
|
|
295
|
+
* @param group
|
|
296
|
+
* The connection group object.
|
|
297
|
+
*
|
|
298
|
+
* @param context
|
|
299
|
+
* A content context representing an inbound message received from this connection group.
|
|
300
|
+
*
|
|
301
|
+
* @result
|
|
302
|
+
* Returns the remote endpoint, or nil if the context is not a valid
|
|
303
|
+
* inbound message received from this connection group.
|
|
304
|
+
*/
|
|
305
|
+
API_AVAILABLE(macos(11.0), ios(14.0), watchos(7.0), tvos(14.0))
|
|
306
|
+
NW_RETURNS_RETAINED _Nullable nw_endpoint_t
|
|
307
|
+
nw_connection_group_copy_remote_endpoint_for_message(nw_connection_group_t group,
|
|
308
|
+
nw_content_context_t context);
|
|
309
|
+
|
|
310
|
+
/*!
|
|
311
|
+
* @function nw_connection_group_copy_local_endpoint_for_message
|
|
312
|
+
*
|
|
313
|
+
* @abstract
|
|
314
|
+
* Copy the local endpoint corresponding to a given inbound connection group message.
|
|
315
|
+
*
|
|
316
|
+
* @param group
|
|
317
|
+
* The connection group object.
|
|
318
|
+
*
|
|
319
|
+
* @param context
|
|
320
|
+
* A content context representing an inbound message received from this connection group.
|
|
321
|
+
*
|
|
322
|
+
* @result
|
|
323
|
+
* Returns the local endpoint, or nil if the context is not a valid
|
|
324
|
+
* inbound message received from this connection group.
|
|
325
|
+
*/
|
|
326
|
+
API_AVAILABLE(macos(11.0), ios(14.0), watchos(7.0), tvos(14.0))
|
|
327
|
+
NW_RETURNS_RETAINED _Nullable nw_endpoint_t
|
|
328
|
+
nw_connection_group_copy_local_endpoint_for_message(nw_connection_group_t group,
|
|
329
|
+
nw_content_context_t context);
|
|
330
|
+
|
|
331
|
+
/*!
|
|
332
|
+
* @function nw_connection_group_copy_path_for_message
|
|
333
|
+
*
|
|
334
|
+
* @abstract
|
|
335
|
+
* Copy the path associated with a given inbound connection group message.
|
|
336
|
+
*
|
|
337
|
+
* @param group
|
|
338
|
+
* The connection group object.
|
|
339
|
+
*
|
|
340
|
+
* @param context
|
|
341
|
+
* A content context representing an inbound message received from this connection group.
|
|
342
|
+
*
|
|
343
|
+
* @result
|
|
344
|
+
* Returns the path associated with the provided message, or nil if the context
|
|
345
|
+
* is not a valid inbound message received from this connection group.
|
|
346
|
+
*/
|
|
347
|
+
API_AVAILABLE(macos(11.0), ios(14.0), watchos(7.0), tvos(14.0))
|
|
348
|
+
NW_RETURNS_RETAINED _Nullable nw_path_t
|
|
349
|
+
nw_connection_group_copy_path_for_message(nw_connection_group_t group,
|
|
350
|
+
nw_content_context_t context);
|
|
351
|
+
|
|
352
|
+
/*!
|
|
353
|
+
* @function nw_connection_group_copy_protocol_metadata_for_message
|
|
354
|
+
*
|
|
355
|
+
* @abstract
|
|
356
|
+
* Copy the metadata corresponding to a given inbound connection group message.
|
|
357
|
+
*
|
|
358
|
+
* @param group
|
|
359
|
+
* The connection group object.
|
|
360
|
+
*
|
|
361
|
+
* @param definition
|
|
362
|
+
* The protocol definition for which metadata will be returned.
|
|
363
|
+
*
|
|
364
|
+
* @result
|
|
365
|
+
* Returns a retained protocol metadata object, or NULL if not found.
|
|
366
|
+
*/
|
|
367
|
+
API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0))
|
|
368
|
+
_Nullable nw_protocol_metadata_t
|
|
369
|
+
nw_connection_group_copy_protocol_metadata_for_message(nw_connection_group_t group,
|
|
370
|
+
nw_content_context_t context,
|
|
371
|
+
nw_protocol_definition_t definition);
|
|
372
|
+
|
|
373
|
+
/*!
|
|
374
|
+
* @function nw_connection_group_extract_connection_for_message
|
|
375
|
+
*
|
|
376
|
+
* @abstract
|
|
377
|
+
* Extract a connection corresponding to an inbound message from the
|
|
378
|
+
* connection group. Once extracted, subsequent messages from this
|
|
379
|
+
* remote endpoint on this connection will no longer be handled by the
|
|
380
|
+
* connection group. The connection may be used to read the remainder
|
|
381
|
+
* of a partial message or to send a large response with support for partial
|
|
382
|
+
* messages and backpressure.
|
|
383
|
+
* Any incoming messages from this remote endpoint which were saved from
|
|
384
|
+
* the receive handler may no longer be valid after a connection is returned.
|
|
385
|
+
* An extracted connection must have a queue set and be started before it can be used.
|
|
386
|
+
*
|
|
387
|
+
* @param group
|
|
388
|
+
* The connection group object from which the context was received. If the context was
|
|
389
|
+
* not received from this connection group, the extraction will fail.
|
|
390
|
+
*
|
|
391
|
+
* @param context
|
|
392
|
+
* A content context representing an inbound message received from this connection group.
|
|
393
|
+
*
|
|
394
|
+
* @result
|
|
395
|
+
* Returns the connection associated with the provided message, or nil if the extraction
|
|
396
|
+
* fails. Extraction will fail if the provided message is not an inbound message from
|
|
397
|
+
* this connection group.
|
|
398
|
+
*/
|
|
399
|
+
API_AVAILABLE(macos(11.0), ios(14.0), watchos(7.0), tvos(14.0))
|
|
400
|
+
NW_RETURNS_RETAINED _Nullable nw_connection_t
|
|
401
|
+
nw_connection_group_extract_connection_for_message(nw_connection_group_t group,
|
|
402
|
+
nw_content_context_t context);
|
|
403
|
+
|
|
404
|
+
/*!
|
|
405
|
+
* @function nw_connection_group_reply
|
|
406
|
+
*
|
|
407
|
+
* @abstract
|
|
408
|
+
* Send data in response to an inbound message received by a connection group.
|
|
409
|
+
*
|
|
410
|
+
* @param group
|
|
411
|
+
* The connection group object from which the reply_context was received.
|
|
412
|
+
*
|
|
413
|
+
* @param inbound_message
|
|
414
|
+
* The inbound message received by the connection group for which this is a response.
|
|
415
|
+
* An inbound message may be replied to exactly once.
|
|
416
|
+
*
|
|
417
|
+
* @param outbound_message
|
|
418
|
+
* The outbound message to send in response to the message received by the connection group.
|
|
419
|
+
*
|
|
420
|
+
* The response context can also hold protocol metadata to define how to
|
|
421
|
+
* send content, such as flags for IP packets.
|
|
422
|
+
*
|
|
423
|
+
* If the context is marked as "final", the connection group will expect that no further communication is
|
|
424
|
+
* expected during this connection with the peer and may close the underlying transport.
|
|
425
|
+
* Subsequent connection attempts from the peer will continue to be delivered as incoming messages.
|
|
426
|
+
*
|
|
427
|
+
* @param content
|
|
428
|
+
* A data object to send as the message body. This may be NULL if the outgoing
|
|
429
|
+
* context represents a metadata only message that contains no body data.
|
|
430
|
+
*
|
|
431
|
+
*/
|
|
432
|
+
API_AVAILABLE(macos(11.0), ios(14.0), watchos(7.0), tvos(14.0))
|
|
433
|
+
void
|
|
434
|
+
nw_connection_group_reply(nw_connection_group_t group,
|
|
435
|
+
nw_content_context_t inbound_message,
|
|
436
|
+
nw_content_context_t outbound_message,
|
|
437
|
+
dispatch_data_t _Nullable content);
|
|
438
|
+
|
|
439
|
+
/*!
|
|
440
|
+
* @function nw_connection_group_extract_connection
|
|
441
|
+
*
|
|
442
|
+
* @abstract
|
|
443
|
+
* Extract a connection from the connection group. For a multiplex connection group, this means that
|
|
444
|
+
* a new stream is opened and the corresponding nw_connection_t object is returned. For non-multiplex
|
|
445
|
+
* connection groups, a connection to the specified endpoint will be returned if allowed by the group descriptor.
|
|
446
|
+
*
|
|
447
|
+
* The connection can be re-inserted into the group later. Once reinserted, the connection group
|
|
448
|
+
* will handle subsequent messages from this remote endpoint.
|
|
449
|
+
* An extracted connection must have a queue set and be started before it can be used.
|
|
450
|
+
*
|
|
451
|
+
* @param group
|
|
452
|
+
* The connection group object from which to extract a connection.
|
|
453
|
+
*
|
|
454
|
+
* @param endpoint
|
|
455
|
+
* The endpoint to use as the remote endpoint for the extracted connection, if applicable.
|
|
456
|
+
* For connection groups with multiplex group descriptors, this should be nil.
|
|
457
|
+
*
|
|
458
|
+
* @param protocol_options
|
|
459
|
+
* The protocol options to apply to the extracted connection. May be nil if not applicable.
|
|
460
|
+
*
|
|
461
|
+
* @result
|
|
462
|
+
* Returns the connection from the connection group.
|
|
463
|
+
*/
|
|
464
|
+
API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0))
|
|
465
|
+
NW_RETURNS_RETAINED _Nullable nw_connection_t
|
|
466
|
+
nw_connection_group_extract_connection(nw_connection_group_t group,
|
|
467
|
+
_Nullable nw_endpoint_t endpoint,
|
|
468
|
+
_Nullable nw_protocol_options_t protocol_options);
|
|
469
|
+
|
|
470
|
+
/*!
|
|
471
|
+
* @function nw_connection_group_reinsert_extracted_connection
|
|
472
|
+
*
|
|
473
|
+
* @abstract
|
|
474
|
+
* Reinsert a connection into a connection group. Once reinserted, the connection group
|
|
475
|
+
* will handle subsequent messages from this remote endpoint, and any outstanding reads on
|
|
476
|
+
* the connection will be cancelled.
|
|
477
|
+
*
|
|
478
|
+
* @param group
|
|
479
|
+
* The connection group object from which the connection was extracted. If the connection was
|
|
480
|
+
* not extracted from this connection group, the reinsertion will fail.
|
|
481
|
+
*
|
|
482
|
+
* @param connection
|
|
483
|
+
* A connection that was extracted from this connection group.
|
|
484
|
+
*
|
|
485
|
+
* @result
|
|
486
|
+
* Returns true if the reinsertion was successful. Reinsertion will fail if the provided connection was
|
|
487
|
+
* not extracted from this connection group.
|
|
488
|
+
*/
|
|
489
|
+
API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0))
|
|
490
|
+
bool
|
|
491
|
+
nw_connection_group_reinsert_extracted_connection(nw_connection_group_t group,
|
|
492
|
+
nw_connection_t connection);
|
|
493
|
+
|
|
494
|
+
#ifdef __BLOCKS__
|
|
495
|
+
|
|
496
|
+
/*!
|
|
497
|
+
* @typedef nw_connection_group_send_completion_t
|
|
498
|
+
* @abstract
|
|
499
|
+
* A send completion is invoked exactly once for a call to nw_connection_group_send_message().
|
|
500
|
+
* The completion indicates that the sent content has been processed by the stack
|
|
501
|
+
* (not necessarily that it has left the host), or else an error has occurred during
|
|
502
|
+
* sending.
|
|
503
|
+
*
|
|
504
|
+
* @param error
|
|
505
|
+
* An error will be delivered if the associated content could not be fully sent before an
|
|
506
|
+
* error occurred. An error will be sent for any outstanding sends when the connection
|
|
507
|
+
* is cancelled.
|
|
508
|
+
*/
|
|
509
|
+
typedef void (^nw_connection_group_send_completion_t)(_Nullable nw_error_t error);
|
|
510
|
+
|
|
511
|
+
/*!
|
|
512
|
+
* @function nw_connection_group_send_message
|
|
513
|
+
*
|
|
514
|
+
* @abstract
|
|
515
|
+
* Send data that is not in response to an inbound message. This outgoing
|
|
516
|
+
* message will be sent from the local endpoint on which the connection group is
|
|
517
|
+
* listening for incoming messages.
|
|
518
|
+
*
|
|
519
|
+
* This is an asynchronous send and the completion block can be used to
|
|
520
|
+
* determine when the send is complete. There is nothing preventing a client
|
|
521
|
+
* from issuing an excessive number of outstanding sends. To minimize memory
|
|
522
|
+
* footprint and excessive latency as a consequence of buffer bloat, it is
|
|
523
|
+
* advisable to keep a low number of outstanding sends. The completion block
|
|
524
|
+
* can be used to pace subsequent sends.
|
|
525
|
+
*
|
|
526
|
+
* @param group
|
|
527
|
+
* The connection group object from which to send the outbound data.
|
|
528
|
+
*
|
|
529
|
+
* @param content
|
|
530
|
+
* A data object to send as the message body. This may be NULL if the outgoing
|
|
531
|
+
* context represents a metadata only message that contains no body data.
|
|
532
|
+
*
|
|
533
|
+
* @param endpoint
|
|
534
|
+
* The destination endpoint to which the outbound message should be sent. If the
|
|
535
|
+
* endpoint is NULL, the message will be sent to all members of the group.
|
|
536
|
+
*
|
|
537
|
+
* @param context
|
|
538
|
+
* An outbound message to send from the connection group.
|
|
539
|
+
*
|
|
540
|
+
* The context can also hold protocol metadata to define how to send content,
|
|
541
|
+
* such as flags for IP packets.
|
|
542
|
+
*
|
|
543
|
+
* If the context is marked as "final", the connection group will expect that no further communication is
|
|
544
|
+
* expected during this connection with the peer and may close the underlying transport.
|
|
545
|
+
* Subsequent connection attempts from the peer will be delivered as incoming messages.
|
|
546
|
+
*
|
|
547
|
+
* @param completion
|
|
548
|
+
* A callback to be called when the message has been sent, or an error has occurred.
|
|
549
|
+
* This callback does not indicate that the remote side has acknowledged the data.
|
|
550
|
+
* This callback does indicate that the data has either been sent or it has been
|
|
551
|
+
* enqueued to be sent.
|
|
552
|
+
*/
|
|
553
|
+
API_AVAILABLE(macos(11.0), ios(14.0), watchos(7.0), tvos(14.0))
|
|
554
|
+
NW_SWIFT_DISABLE_ASYNC
|
|
555
|
+
void
|
|
556
|
+
nw_connection_group_send_message(nw_connection_group_t group,
|
|
557
|
+
_Nullable dispatch_data_t content,
|
|
558
|
+
_Nullable nw_endpoint_t endpoint,
|
|
559
|
+
nw_content_context_t context,
|
|
560
|
+
nw_connection_group_send_completion_t completion);
|
|
561
|
+
|
|
562
|
+
/*!
|
|
563
|
+
* @typedef nw_connection_group_new_connection_handler_t
|
|
564
|
+
*
|
|
565
|
+
* @abstract
|
|
566
|
+
* A block called with a new connection when a multiplex group receives a new stream. If a new connection
|
|
567
|
+
* handler is set the user must handle connections received by this handler. There are three possible
|
|
568
|
+
* actions to take and one of these three actions must be taken.
|
|
569
|
+
* 1) Take over the ownership of the connection. In this case, the connection is used by the client to
|
|
570
|
+
* send and receive data as any other connection would be used. The client may insert this
|
|
571
|
+
* connection back into the connection group at a later point if so desired.
|
|
572
|
+
* The connection must have a queue set and be started before it can be used.
|
|
573
|
+
* 2) If you want the connection group to handle this connection, simply insert this connection back into
|
|
574
|
+
* the connection group right away.
|
|
575
|
+
* 3) If you don't want to accept this connection, simply cancel the connection.
|
|
576
|
+
*
|
|
577
|
+
* @param connection
|
|
578
|
+
* The connection representing the new stream on this multiplexing protocol
|
|
579
|
+
*/
|
|
580
|
+
typedef void (^nw_connection_group_new_connection_handler_t)(nw_connection_t connection);
|
|
581
|
+
|
|
582
|
+
/*!
|
|
583
|
+
* @function nw_connection_group_set_new_connection_handler
|
|
584
|
+
*
|
|
585
|
+
* @abstract
|
|
586
|
+
* Sets the new connection handler to be invoked whenever a new inbound connection
|
|
587
|
+
* is received by the connection group. This function must not be called
|
|
588
|
+
* after starting the connection group.
|
|
589
|
+
*
|
|
590
|
+
* @param group
|
|
591
|
+
* The connection group object.
|
|
592
|
+
*
|
|
593
|
+
* @param new_connection_handler
|
|
594
|
+
* The new connection handler to call upon receipt of a new inbound connection.
|
|
595
|
+
* Pass NULL to remove the handler.
|
|
596
|
+
*/
|
|
597
|
+
API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0))
|
|
598
|
+
void
|
|
599
|
+
nw_connection_group_set_new_connection_handler(nw_connection_group_t group,
|
|
600
|
+
_Nullable nw_connection_group_new_connection_handler_t new_connection_handler);
|
|
601
|
+
|
|
602
|
+
/*!
|
|
603
|
+
* @function nw_connection_group_copy_protocol_metadata
|
|
604
|
+
*
|
|
605
|
+
* @abstract
|
|
606
|
+
* Copy the metadata corresponding to a given inbound connection group message.
|
|
607
|
+
*
|
|
608
|
+
* @param group
|
|
609
|
+
* The connection group object.
|
|
610
|
+
*
|
|
611
|
+
* @param definition
|
|
612
|
+
* The protocol definition for which metadata will be returned.
|
|
613
|
+
*
|
|
614
|
+
* @result
|
|
615
|
+
* Returns a retained protocol metadata object, or NULL if the connection
|
|
616
|
+
* group has not been established yet or is cancelled.
|
|
617
|
+
*/
|
|
618
|
+
API_AVAILABLE(macos(12.0), ios(15.0), watchos(8.0), tvos(15.0))
|
|
619
|
+
_Nullable nw_protocol_metadata_t
|
|
620
|
+
nw_connection_group_copy_protocol_metadata(nw_connection_group_t group,
|
|
621
|
+
nw_protocol_definition_t definition);
|
|
622
|
+
|
|
623
|
+
#endif // __BLOCKS__
|
|
624
|
+
|
|
625
|
+
__END_DECLS
|
|
626
|
+
|
|
627
|
+
NW_ASSUME_NONNULL_END
|
|
628
|
+
|
|
629
|
+
#endif /* __NW_CONNECTION_GROUP_H__ */
|