import Dependencies import DependenciesMacros /// The app-side transport seam used by ``NotificationsFeature``. /// /// Authentication, stable installation identity, and provider-specific transport are installed by /// the host. This client registers the current device token, replaces the mounted feature tree's /// desired subscriptions, and exposes incoming signals for that installation. @DependencyClient public struct NotificationsClient: Sendable { public var registerDestination: @Sendable ( _ destination: Push.Destination ) async throws -> Void public var replaceSubscriptions: @Sendable ( _ subscriptions: Set ) async throws -> Void public var synchronize: @Sendable () async throws -> Void public var signals: @Sendable () async -> AsyncStream = { AsyncStream { $0.finish() } } } extension NotificationsClient: TestDependencyKey { public static var testValue: Self { Self( registerDestination: { _ in }, replaceSubscriptions: { _ in }, synchronize: {}, signals: { AsyncStream { $0.finish() } } ) } } extension DependencyValues { public var notificationsClient: NotificationsClient { get { self[NotificationsClient.self] } set { self[NotificationsClient.self] = newValue } } }