package wang.yaojia.webterm.di

import dagger.Binds
import dagger.Module
import dagger.hilt.InstallIn
import dagger.hilt.components.SingletonComponent
import wang.yaojia.webterm.push.PushRegistrarTokenSink
import wang.yaojia.webterm.push.PushTokenSink

/**
 * Push boundary (app-assembly): binds the A31 [PushTokenSink] seam that A30 declared with
 * `@BindsOptionalOf` (in `push/PushTokenSink.kt`). With a concrete `@Binds` present, the
 * `Optional<PushTokenSink>` [wang.yaojia.webterm.push.FcmService] injects resolves to `Optional.of(...)`
 * — the FCM `onNewToken` rotation now reaches [PushRegistrar][wang.yaojia.webterm.push.PushRegistrar]
 * (self-heal). This is the intended optional-collaborator handoff (no mutable global).
 */
@Module
@InstallIn(SingletonComponent::class)
public interface PushModule {
    @Binds
    public fun bindPushTokenSink(impl: PushRegistrarTokenSink): PushTokenSink
}
