@npaw/forge-react-native 9.7.2 → 9.7.4

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 (20) hide show
  1. package/android/build.gradle +1 -1
  2. package/ios/ForgeApple/ForgeKernelFFI.xcframework/Info.plist +7 -7
  3. package/ios/ForgeApple/ForgeKernelFFI.xcframework/ios-arm64/Headers/forge_kernelFFI.h +60 -0
  4. package/ios/ForgeApple/ForgeKernelFFI.xcframework/ios-arm64/libForgeKernelFFI.a +0 -0
  5. package/ios/ForgeApple/ForgeKernelFFI.xcframework/ios-arm64_x86_64-simulator/Headers/forge_kernelFFI.h +60 -0
  6. package/ios/ForgeApple/ForgeKernelFFI.xcframework/ios-arm64_x86_64-simulator/libForgeKernelFFI.a +0 -0
  7. package/ios/ForgeApple/ForgeKernelFFI.xcframework/tvos-arm64/Headers/forge_kernelFFI.h +60 -0
  8. package/ios/ForgeApple/ForgeKernelFFI.xcframework/tvos-arm64/libForgeKernelFFI.a +0 -0
  9. package/ios/ForgeApple/ForgeKernelFFI.xcframework/tvos-arm64-simulator/Headers/forge_kernelFFI.h +60 -0
  10. package/ios/ForgeApple/ForgeKernelFFI.xcframework/tvos-arm64-simulator/libForgeKernelFFI.a +0 -0
  11. package/ios/ForgeApple/Sources/ForgeKernelUniFFI/forge_kernel.swift +415 -1
  12. package/ios/ForgeApple/Sources/ForgeKernelUniFFI/forge_kernelFFI.h +60 -0
  13. package/ios/ForgeApple/Sources/NPAWForgeAVPlayerAdapter/AVPlayerAdapter.swift +22 -1
  14. package/ios/ForgeApple/Sources/NPAWForgeCore/DeviceInsightsCollector.swift +494 -0
  15. package/ios/ForgeApple/Sources/NPAWForgeCore/ForgeApple.swift +51 -0
  16. package/ios/ForgeApple/Sources/NPAWForgeCore/ForgeCapturePlan.swift +14 -0
  17. package/ios/ForgeApple/Sources/NPAWForgeCore/ForgeRuntime.swift +48 -0
  18. package/ios/ForgeApple/Sources/NPAWForgeCore/NPAWForge.swift +49 -1
  19. package/ios/ForgeApple/Sources/NPAWForgeCore/NativeUniFFIRuntime.swift +77 -0
  20. package/package.json +1 -1
@@ -433,6 +433,22 @@ private let UNIFFI_CALLBACK_SUCCESS: Int32 = 0
433
433
  private let UNIFFI_CALLBACK_ERROR: Int32 = 1
434
434
  private let UNIFFI_CALLBACK_UNEXPECTED_ERROR: Int32 = 2
435
435
 
436
+ #if swift(>=5.8)
437
+ @_documentation(visibility: private)
438
+ #endif
439
+ fileprivate struct FfiConverterUInt8: FfiConverterPrimitive {
440
+ typealias FfiType = UInt8
441
+ typealias SwiftType = UInt8
442
+
443
+ public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> UInt8 {
444
+ return try lift(readInt(&buf))
445
+ }
446
+
447
+ public static func write(_ value: UInt8, into buf: inout [UInt8]) {
448
+ writeInt(&buf, lower(value))
449
+ }
450
+ }
451
+
436
452
  #if swift(>=5.8)
437
453
  @_documentation(visibility: private)
438
454
  #endif
@@ -589,6 +605,8 @@ public protocol ForgeRuntimeBridgeProtocol: AnyObject, Sendable {
589
605
 
590
606
  func clearContentMetadataProvider(viewId: UInt64) -> AppleBindingOutcome
591
607
 
608
+ func clearDeviceSampleListener() -> AppleBindingOutcome
609
+
592
610
  func clearLogListener() -> AppleBindingOutcome
593
611
 
594
612
  func clearSessionPreSendHook() -> AppleBindingOutcome
@@ -603,6 +621,8 @@ public protocol ForgeRuntimeBridgeProtocol: AnyObject, Sendable {
603
621
 
604
622
  func recordApplicationForeground(foreground: Bool, timemarkMs: UInt64) -> AppleBindingOutcome
605
623
 
624
+ func recordDeviceSample(sample: AppleDeviceSample) -> AppleBindingOutcome
625
+
606
626
  func recordIdentityEvent(kind: String, timemarkMs: UInt64, fields: [String: String]) -> AppleBindingOutcome
607
627
 
608
628
  func recordLocationFix(latitude: Double, longitude: Double, accuracyM: Double, timestampMs: UInt64) -> AppleBindingOutcome
@@ -619,6 +639,8 @@ public protocol ForgeRuntimeBridgeProtocol: AnyObject, Sendable {
619
639
 
620
640
  func setContentMetadataProvider(viewId: UInt64, provider: AppleContentMetadataProvider) -> AppleBindingOutcome
621
641
 
642
+ func setDeviceSampleListener(listener: AppleDeviceSampleListener) -> AppleBindingOutcome
643
+
622
644
  func setLogLevel(logLevel: String) -> AppleBindingOutcome
623
645
 
624
646
  func setLogListener(listener: AppleLogListener) -> AppleBindingOutcome
@@ -718,6 +740,14 @@ open func clearContentMetadataProvider(viewId: UInt64) -> AppleBindingOutcome {
718
740
  })
719
741
  }
720
742
 
743
+ open func clearDeviceSampleListener() -> AppleBindingOutcome {
744
+ return try! FfiConverterTypeAppleBindingOutcome_lift(try! rustCall() {
745
+ uniffi_forge_kernel_uniffi_fn_method_forgeruntimebridge_clear_device_sample_listener(
746
+ self.uniffiCloneHandle(),$0
747
+ )
748
+ })
749
+ }
750
+
721
751
  open func clearLogListener() -> AppleBindingOutcome {
722
752
  return try! FfiConverterTypeAppleBindingOutcome_lift(try! rustCall() {
723
753
  uniffi_forge_kernel_uniffi_fn_method_forgeruntimebridge_clear_log_listener(
@@ -785,6 +815,15 @@ open func recordApplicationForeground(foreground: Bool, timemarkMs: UInt64) -> A
785
815
  })
786
816
  }
787
817
 
818
+ open func recordDeviceSample(sample: AppleDeviceSample) -> AppleBindingOutcome {
819
+ return try! FfiConverterTypeAppleBindingOutcome_lift(try! rustCall() {
820
+ uniffi_forge_kernel_uniffi_fn_method_forgeruntimebridge_record_device_sample(
821
+ self.uniffiCloneHandle(),
822
+ FfiConverterTypeAppleDeviceSample_lower(sample),$0
823
+ )
824
+ })
825
+ }
826
+
788
827
  open func recordIdentityEvent(kind: String, timemarkMs: UInt64, fields: [String: String]) -> AppleBindingOutcome {
789
828
  return try! FfiConverterTypeAppleBindingOutcome_lift(try! rustCall() {
790
829
  uniffi_forge_kernel_uniffi_fn_method_forgeruntimebridge_record_identity_event(
@@ -869,6 +908,15 @@ open func setContentMetadataProvider(viewId: UInt64, provider: AppleContentMetad
869
908
  })
870
909
  }
871
910
 
911
+ open func setDeviceSampleListener(listener: AppleDeviceSampleListener) -> AppleBindingOutcome {
912
+ return try! FfiConverterTypeAppleBindingOutcome_lift(try! rustCall() {
913
+ uniffi_forge_kernel_uniffi_fn_method_forgeruntimebridge_set_device_sample_listener(
914
+ self.uniffiCloneHandle(),
915
+ FfiConverterCallbackInterfaceAppleDeviceSampleListener_lower(listener),$0
916
+ )
917
+ })
918
+ }
919
+
872
920
  open func setLogLevel(logLevel: String) -> AppleBindingOutcome {
873
921
  return try! FfiConverterTypeAppleBindingOutcome_lift(try! rustCall() {
874
922
  uniffi_forge_kernel_uniffi_fn_method_forgeruntimebridge_set_log_level(
@@ -1217,11 +1265,12 @@ public struct AppleCapturePlan: Equatable, Hashable {
1217
1265
  public var attributionIncludeLandingUrl: Bool
1218
1266
  public var attributionDeriveFromDeepLinks: Bool
1219
1267
  public var attributionInstallReferrerEnabled: Bool
1268
+ public var deviceInsightFamilies: [String]
1220
1269
  public var hash: String
1221
1270
 
1222
1271
  // Default memberwise initializers are never public by default, so we
1223
1272
  // declare one manually.
1224
- public init(planSeq: UInt64, bits: UInt32, configVersion: String?, focusDwellThresholdMs: UInt64, focusDedupeMs: UInt64, focusRepeatUnchangedDwell: Bool, maxTargetTextLength: UInt32, maxPayloadFields: UInt32, joinMethod: String?, seekHeuristicEnabled: Bool?, seekJumpThresholdMs: UInt64?, metadataSamplingMs: UInt64?, sectionsVisibilityThresholdPct: UInt32, sectionsImpressionMinVisibleMs: UInt64, sectionsDwellMs: UInt64, sectionsMaxTrackedItems: UInt32, sectionsMaxSections: UInt32, sectionsSectionSelector: String?, sectionsItemSelector: String?, sectionsSectionNativeIds: [String], sectionsItemNativeIds: [String], sectionsNameFrom: String, targetDataAttributes: [String], attributionExtraQueryKeys: [String], attributionIncludeLandingUrl: Bool, attributionDeriveFromDeepLinks: Bool, attributionInstallReferrerEnabled: Bool, hash: String) {
1273
+ public init(planSeq: UInt64, bits: UInt32, configVersion: String?, focusDwellThresholdMs: UInt64, focusDedupeMs: UInt64, focusRepeatUnchangedDwell: Bool, maxTargetTextLength: UInt32, maxPayloadFields: UInt32, joinMethod: String?, seekHeuristicEnabled: Bool?, seekJumpThresholdMs: UInt64?, metadataSamplingMs: UInt64?, sectionsVisibilityThresholdPct: UInt32, sectionsImpressionMinVisibleMs: UInt64, sectionsDwellMs: UInt64, sectionsMaxTrackedItems: UInt32, sectionsMaxSections: UInt32, sectionsSectionSelector: String?, sectionsItemSelector: String?, sectionsSectionNativeIds: [String], sectionsItemNativeIds: [String], sectionsNameFrom: String, targetDataAttributes: [String], attributionExtraQueryKeys: [String], attributionIncludeLandingUrl: Bool, attributionDeriveFromDeepLinks: Bool, attributionInstallReferrerEnabled: Bool, deviceInsightFamilies: [String], hash: String) {
1225
1274
  self.planSeq = planSeq
1226
1275
  self.bits = bits
1227
1276
  self.configVersion = configVersion
@@ -1249,6 +1298,7 @@ public struct AppleCapturePlan: Equatable, Hashable {
1249
1298
  self.attributionIncludeLandingUrl = attributionIncludeLandingUrl
1250
1299
  self.attributionDeriveFromDeepLinks = attributionDeriveFromDeepLinks
1251
1300
  self.attributionInstallReferrerEnabled = attributionInstallReferrerEnabled
1301
+ self.deviceInsightFamilies = deviceInsightFamilies
1252
1302
  self.hash = hash
1253
1303
  }
1254
1304
 
@@ -1295,6 +1345,7 @@ public struct FfiConverterTypeAppleCapturePlan: FfiConverterRustBuffer {
1295
1345
  attributionIncludeLandingUrl: FfiConverterBool.read(from: &buf),
1296
1346
  attributionDeriveFromDeepLinks: FfiConverterBool.read(from: &buf),
1297
1347
  attributionInstallReferrerEnabled: FfiConverterBool.read(from: &buf),
1348
+ deviceInsightFamilies: FfiConverterSequenceString.read(from: &buf),
1298
1349
  hash: FfiConverterString.read(from: &buf)
1299
1350
  )
1300
1351
  }
@@ -1327,6 +1378,7 @@ public struct FfiConverterTypeAppleCapturePlan: FfiConverterRustBuffer {
1327
1378
  FfiConverterBool.write(value.attributionIncludeLandingUrl, into: &buf)
1328
1379
  FfiConverterBool.write(value.attributionDeriveFromDeepLinks, into: &buf)
1329
1380
  FfiConverterBool.write(value.attributionInstallReferrerEnabled, into: &buf)
1381
+ FfiConverterSequenceString.write(value.deviceInsightFamilies, into: &buf)
1330
1382
  FfiConverterString.write(value.hash, into: &buf)
1331
1383
  }
1332
1384
  }
@@ -1521,6 +1573,88 @@ public func FfiConverterTypeAppleContentMetadata_lower(_ value: AppleContentMeta
1521
1573
  }
1522
1574
 
1523
1575
 
1576
+ public struct AppleDeviceSample: Equatable, Hashable {
1577
+ public var sampledAtMs: UInt64
1578
+ public var cpuTimeMs: UInt64?
1579
+ public var cpuCores: UInt32?
1580
+ public var memUsedBytes: UInt64?
1581
+ public var memAvailBytes: UInt64?
1582
+ public var batteryLevelPct: UInt8?
1583
+ public var batteryCharging: Bool?
1584
+ public var thermal: AppleThermalState?
1585
+ public var diskFreeBytes: UInt64?
1586
+
1587
+ // Default memberwise initializers are never public by default, so we
1588
+ // declare one manually.
1589
+ public init(sampledAtMs: UInt64, cpuTimeMs: UInt64?, cpuCores: UInt32?, memUsedBytes: UInt64?, memAvailBytes: UInt64?, batteryLevelPct: UInt8?, batteryCharging: Bool?, thermal: AppleThermalState?, diskFreeBytes: UInt64?) {
1590
+ self.sampledAtMs = sampledAtMs
1591
+ self.cpuTimeMs = cpuTimeMs
1592
+ self.cpuCores = cpuCores
1593
+ self.memUsedBytes = memUsedBytes
1594
+ self.memAvailBytes = memAvailBytes
1595
+ self.batteryLevelPct = batteryLevelPct
1596
+ self.batteryCharging = batteryCharging
1597
+ self.thermal = thermal
1598
+ self.diskFreeBytes = diskFreeBytes
1599
+ }
1600
+
1601
+
1602
+
1603
+
1604
+ }
1605
+
1606
+ #if compiler(>=6)
1607
+ extension AppleDeviceSample: Sendable {}
1608
+ #endif
1609
+
1610
+ #if swift(>=5.8)
1611
+ @_documentation(visibility: private)
1612
+ #endif
1613
+ public struct FfiConverterTypeAppleDeviceSample: FfiConverterRustBuffer {
1614
+ public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> AppleDeviceSample {
1615
+ return
1616
+ try AppleDeviceSample(
1617
+ sampledAtMs: FfiConverterUInt64.read(from: &buf),
1618
+ cpuTimeMs: FfiConverterOptionUInt64.read(from: &buf),
1619
+ cpuCores: FfiConverterOptionUInt32.read(from: &buf),
1620
+ memUsedBytes: FfiConverterOptionUInt64.read(from: &buf),
1621
+ memAvailBytes: FfiConverterOptionUInt64.read(from: &buf),
1622
+ batteryLevelPct: FfiConverterOptionUInt8.read(from: &buf),
1623
+ batteryCharging: FfiConverterOptionBool.read(from: &buf),
1624
+ thermal: FfiConverterOptionTypeAppleThermalState.read(from: &buf),
1625
+ diskFreeBytes: FfiConverterOptionUInt64.read(from: &buf)
1626
+ )
1627
+ }
1628
+
1629
+ public static func write(_ value: AppleDeviceSample, into buf: inout [UInt8]) {
1630
+ FfiConverterUInt64.write(value.sampledAtMs, into: &buf)
1631
+ FfiConverterOptionUInt64.write(value.cpuTimeMs, into: &buf)
1632
+ FfiConverterOptionUInt32.write(value.cpuCores, into: &buf)
1633
+ FfiConverterOptionUInt64.write(value.memUsedBytes, into: &buf)
1634
+ FfiConverterOptionUInt64.write(value.memAvailBytes, into: &buf)
1635
+ FfiConverterOptionUInt8.write(value.batteryLevelPct, into: &buf)
1636
+ FfiConverterOptionBool.write(value.batteryCharging, into: &buf)
1637
+ FfiConverterOptionTypeAppleThermalState.write(value.thermal, into: &buf)
1638
+ FfiConverterOptionUInt64.write(value.diskFreeBytes, into: &buf)
1639
+ }
1640
+ }
1641
+
1642
+
1643
+ #if swift(>=5.8)
1644
+ @_documentation(visibility: private)
1645
+ #endif
1646
+ public func FfiConverterTypeAppleDeviceSample_lift(_ buf: RustBuffer) throws -> AppleDeviceSample {
1647
+ return try FfiConverterTypeAppleDeviceSample.lift(buf)
1648
+ }
1649
+
1650
+ #if swift(>=5.8)
1651
+ @_documentation(visibility: private)
1652
+ #endif
1653
+ public func FfiConverterTypeAppleDeviceSample_lower(_ value: AppleDeviceSample) -> RustBuffer {
1654
+ return FfiConverterTypeAppleDeviceSample.lower(value)
1655
+ }
1656
+
1657
+
1524
1658
  public struct AppleMetadataSnapshot: Equatable, Hashable {
1525
1659
  public var content: AppleContentMetadata
1526
1660
  public var qos: AppleQosSnapshot?
@@ -2729,6 +2863,94 @@ public func FfiConverterTypeAppleContentType_lower(_ value: AppleContentType) ->
2729
2863
  }
2730
2864
 
2731
2865
 
2866
+ // Note that we don't yet support `indirect` for enums.
2867
+ // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion.
2868
+
2869
+ public enum AppleThermalState: Equatable, Hashable {
2870
+
2871
+ case nominal
2872
+ case fair
2873
+ case serious
2874
+ case critical
2875
+ case emergency
2876
+
2877
+
2878
+
2879
+
2880
+
2881
+ }
2882
+
2883
+ #if compiler(>=6)
2884
+ extension AppleThermalState: Sendable {}
2885
+ #endif
2886
+
2887
+ #if swift(>=5.8)
2888
+ @_documentation(visibility: private)
2889
+ #endif
2890
+ public struct FfiConverterTypeAppleThermalState: FfiConverterRustBuffer {
2891
+ typealias SwiftType = AppleThermalState
2892
+
2893
+ public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> AppleThermalState {
2894
+ let variant: Int32 = try readInt(&buf)
2895
+ switch variant {
2896
+
2897
+ case 1: return .nominal
2898
+
2899
+ case 2: return .fair
2900
+
2901
+ case 3: return .serious
2902
+
2903
+ case 4: return .critical
2904
+
2905
+ case 5: return .emergency
2906
+
2907
+ default: throw UniffiInternalError.unexpectedEnumCase
2908
+ }
2909
+ }
2910
+
2911
+ public static func write(_ value: AppleThermalState, into buf: inout [UInt8]) {
2912
+ switch value {
2913
+
2914
+
2915
+ case .nominal:
2916
+ writeInt(&buf, Int32(1))
2917
+
2918
+
2919
+ case .fair:
2920
+ writeInt(&buf, Int32(2))
2921
+
2922
+
2923
+ case .serious:
2924
+ writeInt(&buf, Int32(3))
2925
+
2926
+
2927
+ case .critical:
2928
+ writeInt(&buf, Int32(4))
2929
+
2930
+
2931
+ case .emergency:
2932
+ writeInt(&buf, Int32(5))
2933
+
2934
+ }
2935
+ }
2936
+ }
2937
+
2938
+
2939
+ #if swift(>=5.8)
2940
+ @_documentation(visibility: private)
2941
+ #endif
2942
+ public func FfiConverterTypeAppleThermalState_lift(_ buf: RustBuffer) throws -> AppleThermalState {
2943
+ return try FfiConverterTypeAppleThermalState.lift(buf)
2944
+ }
2945
+
2946
+ #if swift(>=5.8)
2947
+ @_documentation(visibility: private)
2948
+ #endif
2949
+ public func FfiConverterTypeAppleThermalState_lower(_ value: AppleThermalState) -> RustBuffer {
2950
+ return FfiConverterTypeAppleThermalState.lower(value)
2951
+ }
2952
+
2953
+
2732
2954
  // Note that we don't yet support `indirect` for enums.
2733
2955
  // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion.
2734
2956
 
@@ -3161,6 +3383,137 @@ public func FfiConverterCallbackInterfaceAppleContentMetadataProvider_lower(_ v:
3161
3383
 
3162
3384
 
3163
3385
 
3386
+ public protocol AppleDeviceSampleListener: AnyObject, Sendable {
3387
+
3388
+ func onSampleRequest(families: [String])
3389
+
3390
+ }
3391
+
3392
+
3393
+ // Put the implementation in a struct so we don't pollute the top-level namespace
3394
+ fileprivate struct UniffiCallbackInterfaceAppleDeviceSampleListener {
3395
+
3396
+ // Create the VTable using a series of closures.
3397
+ // Swift automatically converts these into C callback functions.
3398
+ //
3399
+ // Store the vtable directly.
3400
+ static let vtable: UniffiVTableCallbackInterfaceAppleDeviceSampleListener = UniffiVTableCallbackInterfaceAppleDeviceSampleListener(
3401
+ uniffiFree: { (uniffiHandle: UInt64) -> () in
3402
+ do {
3403
+ try FfiConverterCallbackInterfaceAppleDeviceSampleListener.handleMap.remove(handle: uniffiHandle)
3404
+ } catch {
3405
+ print("Uniffi callback interface AppleDeviceSampleListener: handle missing in uniffiFree")
3406
+ }
3407
+ },
3408
+ uniffiClone: { (uniffiHandle: UInt64) -> UInt64 in
3409
+ do {
3410
+ return try FfiConverterCallbackInterfaceAppleDeviceSampleListener.handleMap.clone(handle: uniffiHandle)
3411
+ } catch {
3412
+ fatalError("Uniffi callback interface AppleDeviceSampleListener: handle missing in uniffiClone")
3413
+ }
3414
+ },
3415
+ onSampleRequest: { (
3416
+ uniffiHandle: UInt64,
3417
+ families: RustBuffer,
3418
+ uniffiOutReturn: UnsafeMutableRawPointer,
3419
+ uniffiCallStatus: UnsafeMutablePointer<RustCallStatus>
3420
+ ) in
3421
+ let makeCall = {
3422
+ () throws -> () in
3423
+ guard let uniffiObj = try? FfiConverterCallbackInterfaceAppleDeviceSampleListener.handleMap.get(handle: uniffiHandle) else {
3424
+ throw UniffiInternalError.unexpectedStaleHandle
3425
+ }
3426
+ return uniffiObj.onSampleRequest(
3427
+ families: try FfiConverterSequenceString.lift(families)
3428
+ )
3429
+ }
3430
+
3431
+
3432
+ let writeReturn = { () }
3433
+ uniffiTraitInterfaceCall(
3434
+ callStatus: uniffiCallStatus,
3435
+ makeCall: makeCall,
3436
+ writeReturn: writeReturn
3437
+ )
3438
+ }
3439
+ )
3440
+
3441
+ // Rust stores this pointer for future callback invocations, so it must live
3442
+ // for the process lifetime (not just for the init function call).
3443
+ static let vtablePtr: UnsafePointer<UniffiVTableCallbackInterfaceAppleDeviceSampleListener> = {
3444
+ let ptr = UnsafeMutablePointer<UniffiVTableCallbackInterfaceAppleDeviceSampleListener>.allocate(capacity: 1)
3445
+ ptr.initialize(to: vtable)
3446
+ return UnsafePointer(ptr)
3447
+ }()
3448
+ }
3449
+
3450
+ private func uniffiCallbackInitAppleDeviceSampleListener() {
3451
+ uniffi_forge_kernel_uniffi_fn_init_callback_vtable_appledevicesamplelistener(UniffiCallbackInterfaceAppleDeviceSampleListener.vtablePtr)
3452
+ }
3453
+
3454
+ // FfiConverter protocol for callback interfaces
3455
+ #if swift(>=5.8)
3456
+ @_documentation(visibility: private)
3457
+ #endif
3458
+ fileprivate struct FfiConverterCallbackInterfaceAppleDeviceSampleListener {
3459
+ fileprivate static let handleMap = UniffiHandleMap<AppleDeviceSampleListener>()
3460
+ }
3461
+
3462
+ #if swift(>=5.8)
3463
+ @_documentation(visibility: private)
3464
+ #endif
3465
+ extension FfiConverterCallbackInterfaceAppleDeviceSampleListener : FfiConverter {
3466
+ typealias SwiftType = AppleDeviceSampleListener
3467
+ typealias FfiType = UInt64
3468
+
3469
+ #if swift(>=5.8)
3470
+ @_documentation(visibility: private)
3471
+ #endif
3472
+ public static func lift(_ handle: UInt64) throws -> SwiftType {
3473
+ try handleMap.get(handle: handle)
3474
+ }
3475
+
3476
+ #if swift(>=5.8)
3477
+ @_documentation(visibility: private)
3478
+ #endif
3479
+ public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType {
3480
+ let handle: UInt64 = try readInt(&buf)
3481
+ return try lift(handle)
3482
+ }
3483
+
3484
+ #if swift(>=5.8)
3485
+ @_documentation(visibility: private)
3486
+ #endif
3487
+ public static func lower(_ v: SwiftType) -> UInt64 {
3488
+ return handleMap.insert(obj: v)
3489
+ }
3490
+
3491
+ #if swift(>=5.8)
3492
+ @_documentation(visibility: private)
3493
+ #endif
3494
+ public static func write(_ v: SwiftType, into buf: inout [UInt8]) {
3495
+ writeInt(&buf, lower(v))
3496
+ }
3497
+ }
3498
+
3499
+
3500
+ #if swift(>=5.8)
3501
+ @_documentation(visibility: private)
3502
+ #endif
3503
+ public func FfiConverterCallbackInterfaceAppleDeviceSampleListener_lift(_ handle: UInt64) throws -> AppleDeviceSampleListener {
3504
+ return try FfiConverterCallbackInterfaceAppleDeviceSampleListener.lift(handle)
3505
+ }
3506
+
3507
+ #if swift(>=5.8)
3508
+ @_documentation(visibility: private)
3509
+ #endif
3510
+ public func FfiConverterCallbackInterfaceAppleDeviceSampleListener_lower(_ v: AppleDeviceSampleListener) -> UInt64 {
3511
+ return FfiConverterCallbackInterfaceAppleDeviceSampleListener.lower(v)
3512
+ }
3513
+
3514
+
3515
+
3516
+
3164
3517
  public protocol AppleLogListener: AnyObject, Sendable {
3165
3518
 
3166
3519
  func onLog(log: AppleRenderedLog)
@@ -3559,6 +3912,30 @@ public func FfiConverterCallbackInterfaceAppleVideoPreSendHook_lower(_ v: AppleV
3559
3912
  return FfiConverterCallbackInterfaceAppleVideoPreSendHook.lower(v)
3560
3913
  }
3561
3914
 
3915
+ #if swift(>=5.8)
3916
+ @_documentation(visibility: private)
3917
+ #endif
3918
+ fileprivate struct FfiConverterOptionUInt8: FfiConverterRustBuffer {
3919
+ typealias SwiftType = UInt8?
3920
+
3921
+ public static func write(_ value: SwiftType, into buf: inout [UInt8]) {
3922
+ guard let value = value else {
3923
+ writeInt(&buf, Int8(0))
3924
+ return
3925
+ }
3926
+ writeInt(&buf, Int8(1))
3927
+ FfiConverterUInt8.write(value, into: &buf)
3928
+ }
3929
+
3930
+ public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType {
3931
+ switch try readInt(&buf) as Int8 {
3932
+ case 0: return nil
3933
+ case 1: return try FfiConverterUInt8.read(from: &buf)
3934
+ default: throw UniffiInternalError.unexpectedOptionalTag
3935
+ }
3936
+ }
3937
+ }
3938
+
3562
3939
  #if swift(>=5.8)
3563
3940
  @_documentation(visibility: private)
3564
3941
  #endif
@@ -3847,6 +4224,30 @@ fileprivate struct FfiConverterOptionTypeAppleAdPosition: FfiConverterRustBuffer
3847
4224
  }
3848
4225
  }
3849
4226
 
4227
+ #if swift(>=5.8)
4228
+ @_documentation(visibility: private)
4229
+ #endif
4230
+ fileprivate struct FfiConverterOptionTypeAppleThermalState: FfiConverterRustBuffer {
4231
+ typealias SwiftType = AppleThermalState?
4232
+
4233
+ public static func write(_ value: SwiftType, into buf: inout [UInt8]) {
4234
+ guard let value = value else {
4235
+ writeInt(&buf, Int8(0))
4236
+ return
4237
+ }
4238
+ writeInt(&buf, Int8(1))
4239
+ FfiConverterTypeAppleThermalState.write(value, into: &buf)
4240
+ }
4241
+
4242
+ public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SwiftType {
4243
+ switch try readInt(&buf) as Int8 {
4244
+ case 0: return nil
4245
+ case 1: return try FfiConverterTypeAppleThermalState.read(from: &buf)
4246
+ default: throw UniffiInternalError.unexpectedOptionalTag
4247
+ }
4248
+ }
4249
+ }
4250
+
3850
4251
  #if swift(>=5.8)
3851
4252
  @_documentation(visibility: private)
3852
4253
  #endif
@@ -4030,6 +4431,9 @@ private let initializationResult: InitializationResult = {
4030
4431
  if (uniffi_forge_kernel_uniffi_checksum_method_forgeruntimebridge_clear_content_metadata_provider() != 29053) {
4031
4432
  return InitializationResult.apiChecksumMismatch
4032
4433
  }
4434
+ if (uniffi_forge_kernel_uniffi_checksum_method_forgeruntimebridge_clear_device_sample_listener() != 37056) {
4435
+ return InitializationResult.apiChecksumMismatch
4436
+ }
4033
4437
  if (uniffi_forge_kernel_uniffi_checksum_method_forgeruntimebridge_clear_log_listener() != 33777) {
4034
4438
  return InitializationResult.apiChecksumMismatch
4035
4439
  }
@@ -4051,6 +4455,9 @@ private let initializationResult: InitializationResult = {
4051
4455
  if (uniffi_forge_kernel_uniffi_checksum_method_forgeruntimebridge_record_application_foreground() != 33514) {
4052
4456
  return InitializationResult.apiChecksumMismatch
4053
4457
  }
4458
+ if (uniffi_forge_kernel_uniffi_checksum_method_forgeruntimebridge_record_device_sample() != 60861) {
4459
+ return InitializationResult.apiChecksumMismatch
4460
+ }
4054
4461
  if (uniffi_forge_kernel_uniffi_checksum_method_forgeruntimebridge_record_identity_event() != 47443) {
4055
4462
  return InitializationResult.apiChecksumMismatch
4056
4463
  }
@@ -4075,6 +4482,9 @@ private let initializationResult: InitializationResult = {
4075
4482
  if (uniffi_forge_kernel_uniffi_checksum_method_forgeruntimebridge_set_content_metadata_provider() != 18303) {
4076
4483
  return InitializationResult.apiChecksumMismatch
4077
4484
  }
4485
+ if (uniffi_forge_kernel_uniffi_checksum_method_forgeruntimebridge_set_device_sample_listener() != 21014) {
4486
+ return InitializationResult.apiChecksumMismatch
4487
+ }
4078
4488
  if (uniffi_forge_kernel_uniffi_checksum_method_forgeruntimebridge_set_log_level() != 1993) {
4079
4489
  return InitializationResult.apiChecksumMismatch
4080
4490
  }
@@ -4102,6 +4512,9 @@ private let initializationResult: InitializationResult = {
4102
4512
  if (uniffi_forge_kernel_uniffi_checksum_method_applecontentmetadataprovider_metadata_snapshot() != 21583) {
4103
4513
  return InitializationResult.apiChecksumMismatch
4104
4514
  }
4515
+ if (uniffi_forge_kernel_uniffi_checksum_method_appledevicesamplelistener_on_sample_request() != 6029) {
4516
+ return InitializationResult.apiChecksumMismatch
4517
+ }
4105
4518
  if (uniffi_forge_kernel_uniffi_checksum_method_appleloglistener_on_log() != 23012) {
4106
4519
  return InitializationResult.apiChecksumMismatch
4107
4520
  }
@@ -4114,6 +4527,7 @@ private let initializationResult: InitializationResult = {
4114
4527
 
4115
4528
  uniffiCallbackInitAppleCapturePlanListener()
4116
4529
  uniffiCallbackInitAppleContentMetadataProvider()
4530
+ uniffiCallbackInitAppleDeviceSampleListener()
4117
4531
  uniffiCallbackInitAppleLogListener()
4118
4532
  uniffiCallbackInitAppleSessionPreSendHook()
4119
4533
  uniffiCallbackInitAppleVideoPreSendHook()
@@ -256,6 +256,13 @@ typedef void (*UniffiCallbackInterfaceAppleContentMetadataProviderMethod0)(uint6
256
256
  RustCallStatus *_Nonnull uniffiCallStatus
257
257
  );
258
258
 
259
+ #endif
260
+ #ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_APPLE_DEVICE_SAMPLE_LISTENER_METHOD0
261
+ #define UNIFFI_FFIDEF_CALLBACK_INTERFACE_APPLE_DEVICE_SAMPLE_LISTENER_METHOD0
262
+ typedef void (*UniffiCallbackInterfaceAppleDeviceSampleListenerMethod0)(uint64_t, RustBuffer, void* _Nonnull,
263
+ RustCallStatus *_Nonnull uniffiCallStatus
264
+ );
265
+
259
266
  #endif
260
267
  #ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_APPLE_LOG_LISTENER_METHOD0
261
268
  #define UNIFFI_FFIDEF_CALLBACK_INTERFACE_APPLE_LOG_LISTENER_METHOD0
@@ -295,6 +302,15 @@ typedef struct UniffiVTableCallbackInterfaceAppleContentMetadataProvider {
295
302
  UniffiCallbackInterfaceAppleContentMetadataProviderMethod0 _Nonnull metadataSnapshot;
296
303
  } UniffiVTableCallbackInterfaceAppleContentMetadataProvider;
297
304
 
305
+ #endif
306
+ #ifndef UNIFFI_FFIDEF_V_TABLE_CALLBACK_INTERFACE_APPLE_DEVICE_SAMPLE_LISTENER
307
+ #define UNIFFI_FFIDEF_V_TABLE_CALLBACK_INTERFACE_APPLE_DEVICE_SAMPLE_LISTENER
308
+ typedef struct UniffiVTableCallbackInterfaceAppleDeviceSampleListener {
309
+ UniffiCallbackInterfaceFree _Nonnull uniffiFree;
310
+ UniffiCallbackInterfaceClone _Nonnull uniffiClone;
311
+ UniffiCallbackInterfaceAppleDeviceSampleListenerMethod0 _Nonnull onSampleRequest;
312
+ } UniffiVTableCallbackInterfaceAppleDeviceSampleListener;
313
+
298
314
  #endif
299
315
  #ifndef UNIFFI_FFIDEF_V_TABLE_CALLBACK_INTERFACE_APPLE_LOG_LISTENER
300
316
  #define UNIFFI_FFIDEF_V_TABLE_CALLBACK_INTERFACE_APPLE_LOG_LISTENER
@@ -353,6 +369,11 @@ RustBuffer uniffi_forge_kernel_uniffi_fn_method_forgeruntimebridge_clear_capture
353
369
  RustBuffer uniffi_forge_kernel_uniffi_fn_method_forgeruntimebridge_clear_content_metadata_provider(uint64_t ptr, uint64_t view_id, RustCallStatus *_Nonnull out_status
354
370
  );
355
371
  #endif
372
+ #ifndef UNIFFI_FFIDEF_UNIFFI_FORGE_KERNEL_UNIFFI_FN_METHOD_FORGERUNTIMEBRIDGE_CLEAR_DEVICE_SAMPLE_LISTENER
373
+ #define UNIFFI_FFIDEF_UNIFFI_FORGE_KERNEL_UNIFFI_FN_METHOD_FORGERUNTIMEBRIDGE_CLEAR_DEVICE_SAMPLE_LISTENER
374
+ RustBuffer uniffi_forge_kernel_uniffi_fn_method_forgeruntimebridge_clear_device_sample_listener(uint64_t ptr, RustCallStatus *_Nonnull out_status
375
+ );
376
+ #endif
356
377
  #ifndef UNIFFI_FFIDEF_UNIFFI_FORGE_KERNEL_UNIFFI_FN_METHOD_FORGERUNTIMEBRIDGE_CLEAR_LOG_LISTENER
357
378
  #define UNIFFI_FFIDEF_UNIFFI_FORGE_KERNEL_UNIFFI_FN_METHOD_FORGERUNTIMEBRIDGE_CLEAR_LOG_LISTENER
358
379
  RustBuffer uniffi_forge_kernel_uniffi_fn_method_forgeruntimebridge_clear_log_listener(uint64_t ptr, RustCallStatus *_Nonnull out_status
@@ -388,6 +409,11 @@ RustBuffer uniffi_forge_kernel_uniffi_fn_method_forgeruntimebridge_record_ad_eve
388
409
  RustBuffer uniffi_forge_kernel_uniffi_fn_method_forgeruntimebridge_record_application_foreground(uint64_t ptr, int8_t foreground, uint64_t timemark_ms, RustCallStatus *_Nonnull out_status
389
410
  );
390
411
  #endif
412
+ #ifndef UNIFFI_FFIDEF_UNIFFI_FORGE_KERNEL_UNIFFI_FN_METHOD_FORGERUNTIMEBRIDGE_RECORD_DEVICE_SAMPLE
413
+ #define UNIFFI_FFIDEF_UNIFFI_FORGE_KERNEL_UNIFFI_FN_METHOD_FORGERUNTIMEBRIDGE_RECORD_DEVICE_SAMPLE
414
+ RustBuffer uniffi_forge_kernel_uniffi_fn_method_forgeruntimebridge_record_device_sample(uint64_t ptr, RustBuffer sample, RustCallStatus *_Nonnull out_status
415
+ );
416
+ #endif
391
417
  #ifndef UNIFFI_FFIDEF_UNIFFI_FORGE_KERNEL_UNIFFI_FN_METHOD_FORGERUNTIMEBRIDGE_RECORD_IDENTITY_EVENT
392
418
  #define UNIFFI_FFIDEF_UNIFFI_FORGE_KERNEL_UNIFFI_FN_METHOD_FORGERUNTIMEBRIDGE_RECORD_IDENTITY_EVENT
393
419
  RustBuffer uniffi_forge_kernel_uniffi_fn_method_forgeruntimebridge_record_identity_event(uint64_t ptr, RustBuffer kind, uint64_t timemark_ms, RustBuffer fields, RustCallStatus *_Nonnull out_status
@@ -428,6 +454,11 @@ RustBuffer uniffi_forge_kernel_uniffi_fn_method_forgeruntimebridge_set_capture_p
428
454
  RustBuffer uniffi_forge_kernel_uniffi_fn_method_forgeruntimebridge_set_content_metadata_provider(uint64_t ptr, uint64_t view_id, uint64_t provider, RustCallStatus *_Nonnull out_status
429
455
  );
430
456
  #endif
457
+ #ifndef UNIFFI_FFIDEF_UNIFFI_FORGE_KERNEL_UNIFFI_FN_METHOD_FORGERUNTIMEBRIDGE_SET_DEVICE_SAMPLE_LISTENER
458
+ #define UNIFFI_FFIDEF_UNIFFI_FORGE_KERNEL_UNIFFI_FN_METHOD_FORGERUNTIMEBRIDGE_SET_DEVICE_SAMPLE_LISTENER
459
+ RustBuffer uniffi_forge_kernel_uniffi_fn_method_forgeruntimebridge_set_device_sample_listener(uint64_t ptr, uint64_t listener, RustCallStatus *_Nonnull out_status
460
+ );
461
+ #endif
431
462
  #ifndef UNIFFI_FFIDEF_UNIFFI_FORGE_KERNEL_UNIFFI_FN_METHOD_FORGERUNTIMEBRIDGE_SET_LOG_LEVEL
432
463
  #define UNIFFI_FFIDEF_UNIFFI_FORGE_KERNEL_UNIFFI_FN_METHOD_FORGERUNTIMEBRIDGE_SET_LOG_LEVEL
433
464
  RustBuffer uniffi_forge_kernel_uniffi_fn_method_forgeruntimebridge_set_log_level(uint64_t ptr, RustBuffer log_level, RustCallStatus *_Nonnull out_status
@@ -468,6 +499,11 @@ void uniffi_forge_kernel_uniffi_fn_init_callback_vtable_applecaptureplanlistener
468
499
  void uniffi_forge_kernel_uniffi_fn_init_callback_vtable_applecontentmetadataprovider(const UniffiVTableCallbackInterfaceAppleContentMetadataProvider* _Nonnull vtable
469
500
  );
470
501
  #endif
502
+ #ifndef UNIFFI_FFIDEF_UNIFFI_FORGE_KERNEL_UNIFFI_FN_INIT_CALLBACK_VTABLE_APPLEDEVICESAMPLELISTENER
503
+ #define UNIFFI_FFIDEF_UNIFFI_FORGE_KERNEL_UNIFFI_FN_INIT_CALLBACK_VTABLE_APPLEDEVICESAMPLELISTENER
504
+ void uniffi_forge_kernel_uniffi_fn_init_callback_vtable_appledevicesamplelistener(const UniffiVTableCallbackInterfaceAppleDeviceSampleListener* _Nonnull vtable
505
+ );
506
+ #endif
471
507
  #ifndef UNIFFI_FFIDEF_UNIFFI_FORGE_KERNEL_UNIFFI_FN_INIT_CALLBACK_VTABLE_APPLELOGLISTENER
472
508
  #define UNIFFI_FFIDEF_UNIFFI_FORGE_KERNEL_UNIFFI_FN_INIT_CALLBACK_VTABLE_APPLELOGLISTENER
473
509
  void uniffi_forge_kernel_uniffi_fn_init_callback_vtable_appleloglistener(const UniffiVTableCallbackInterfaceAppleLogListener* _Nonnull vtable
@@ -771,6 +807,12 @@ uint16_t uniffi_forge_kernel_uniffi_checksum_method_forgeruntimebridge_clear_cap
771
807
  #define UNIFFI_FFIDEF_UNIFFI_FORGE_KERNEL_UNIFFI_CHECKSUM_METHOD_FORGERUNTIMEBRIDGE_CLEAR_CONTENT_METADATA_PROVIDER
772
808
  uint16_t uniffi_forge_kernel_uniffi_checksum_method_forgeruntimebridge_clear_content_metadata_provider(void
773
809
 
810
+ );
811
+ #endif
812
+ #ifndef UNIFFI_FFIDEF_UNIFFI_FORGE_KERNEL_UNIFFI_CHECKSUM_METHOD_FORGERUNTIMEBRIDGE_CLEAR_DEVICE_SAMPLE_LISTENER
813
+ #define UNIFFI_FFIDEF_UNIFFI_FORGE_KERNEL_UNIFFI_CHECKSUM_METHOD_FORGERUNTIMEBRIDGE_CLEAR_DEVICE_SAMPLE_LISTENER
814
+ uint16_t uniffi_forge_kernel_uniffi_checksum_method_forgeruntimebridge_clear_device_sample_listener(void
815
+
774
816
  );
775
817
  #endif
776
818
  #ifndef UNIFFI_FFIDEF_UNIFFI_FORGE_KERNEL_UNIFFI_CHECKSUM_METHOD_FORGERUNTIMEBRIDGE_CLEAR_LOG_LISTENER
@@ -813,6 +855,12 @@ uint16_t uniffi_forge_kernel_uniffi_checksum_method_forgeruntimebridge_record_ad
813
855
  #define UNIFFI_FFIDEF_UNIFFI_FORGE_KERNEL_UNIFFI_CHECKSUM_METHOD_FORGERUNTIMEBRIDGE_RECORD_APPLICATION_FOREGROUND
814
856
  uint16_t uniffi_forge_kernel_uniffi_checksum_method_forgeruntimebridge_record_application_foreground(void
815
857
 
858
+ );
859
+ #endif
860
+ #ifndef UNIFFI_FFIDEF_UNIFFI_FORGE_KERNEL_UNIFFI_CHECKSUM_METHOD_FORGERUNTIMEBRIDGE_RECORD_DEVICE_SAMPLE
861
+ #define UNIFFI_FFIDEF_UNIFFI_FORGE_KERNEL_UNIFFI_CHECKSUM_METHOD_FORGERUNTIMEBRIDGE_RECORD_DEVICE_SAMPLE
862
+ uint16_t uniffi_forge_kernel_uniffi_checksum_method_forgeruntimebridge_record_device_sample(void
863
+
816
864
  );
817
865
  #endif
818
866
  #ifndef UNIFFI_FFIDEF_UNIFFI_FORGE_KERNEL_UNIFFI_CHECKSUM_METHOD_FORGERUNTIMEBRIDGE_RECORD_IDENTITY_EVENT
@@ -861,6 +909,12 @@ uint16_t uniffi_forge_kernel_uniffi_checksum_method_forgeruntimebridge_set_captu
861
909
  #define UNIFFI_FFIDEF_UNIFFI_FORGE_KERNEL_UNIFFI_CHECKSUM_METHOD_FORGERUNTIMEBRIDGE_SET_CONTENT_METADATA_PROVIDER
862
910
  uint16_t uniffi_forge_kernel_uniffi_checksum_method_forgeruntimebridge_set_content_metadata_provider(void
863
911
 
912
+ );
913
+ #endif
914
+ #ifndef UNIFFI_FFIDEF_UNIFFI_FORGE_KERNEL_UNIFFI_CHECKSUM_METHOD_FORGERUNTIMEBRIDGE_SET_DEVICE_SAMPLE_LISTENER
915
+ #define UNIFFI_FFIDEF_UNIFFI_FORGE_KERNEL_UNIFFI_CHECKSUM_METHOD_FORGERUNTIMEBRIDGE_SET_DEVICE_SAMPLE_LISTENER
916
+ uint16_t uniffi_forge_kernel_uniffi_checksum_method_forgeruntimebridge_set_device_sample_listener(void
917
+
864
918
  );
865
919
  #endif
866
920
  #ifndef UNIFFI_FFIDEF_UNIFFI_FORGE_KERNEL_UNIFFI_CHECKSUM_METHOD_FORGERUNTIMEBRIDGE_SET_LOG_LEVEL
@@ -915,6 +969,12 @@ uint16_t uniffi_forge_kernel_uniffi_checksum_method_applecaptureplanlistener_on_
915
969
  #define UNIFFI_FFIDEF_UNIFFI_FORGE_KERNEL_UNIFFI_CHECKSUM_METHOD_APPLECONTENTMETADATAPROVIDER_METADATA_SNAPSHOT
916
970
  uint16_t uniffi_forge_kernel_uniffi_checksum_method_applecontentmetadataprovider_metadata_snapshot(void
917
971
 
972
+ );
973
+ #endif
974
+ #ifndef UNIFFI_FFIDEF_UNIFFI_FORGE_KERNEL_UNIFFI_CHECKSUM_METHOD_APPLEDEVICESAMPLELISTENER_ON_SAMPLE_REQUEST
975
+ #define UNIFFI_FFIDEF_UNIFFI_FORGE_KERNEL_UNIFFI_CHECKSUM_METHOD_APPLEDEVICESAMPLELISTENER_ON_SAMPLE_REQUEST
976
+ uint16_t uniffi_forge_kernel_uniffi_checksum_method_appledevicesamplelistener_on_sample_request(void
977
+
918
978
  );
919
979
  #endif
920
980
  #ifndef UNIFFI_FFIDEF_UNIFFI_FORGE_KERNEL_UNIFFI_CHECKSUM_METHOD_APPLELOGLISTENER_ON_LOG