element-x-ada/annotations/src/main/kotlin/io/element/android/annotations/ContributesNode.kt
2025-11-10 11:05:05 +01:00

31 lines
742 B
Kotlin

/*
* Copyright (c) 2025 Element Creations Ltd.
* Copyright 2023-2025 New Vector Ltd.
*
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial.
* Please see LICENSE files in the repository root for full details.
*/
package io.element.android.annotations
import kotlin.reflect.KClass
/**
* Adds Node to the specified component graph.
* Equivalent to the following declaration:
*
* @BindingContainer
* @ContributesTo(Scope::class)
* abstract class YourNodeModule {
* @Binds
* @IntoMap
* @NodeKey(YourNode::class)
* abstract fun bindYourNodeFactory(factory: YourNode.Factory): AssistedNodeFactory<*>
*}
*/
@Target(AnnotationTarget.CLASS)
annotation class ContributesNode(
val scope: KClass<*>,
)