mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-23 06:10:30 +08:00
Make all event implementations internal
This commit is contained in:
parent
38748e0c10
commit
997261fa3b
@ -25,8 +25,8 @@ import kotlin.coroutines.coroutineContext
|
||||
import kotlin.jvm.JvmField
|
||||
import kotlin.reflect.KClass
|
||||
|
||||
@MiraiInternalAPI
|
||||
fun <L : Listener<E>, E : Event> KClass<out E>.subscribeInternal(listener: L): L {
|
||||
@PublishedApi
|
||||
internal fun <L : Listener<E>, E : Event> KClass<out E>.subscribeInternal(listener: L): L {
|
||||
with(this.listeners()) {
|
||||
addLast(listener)
|
||||
listener.invokeOnCompletion {
|
||||
|
@ -22,9 +22,8 @@ import java.util.function.Consumer
|
||||
import java.util.function.Function
|
||||
import kotlin.coroutines.EmptyCoroutineContext
|
||||
|
||||
@MiraiInternalAPI
|
||||
@Suppress("FunctionName")
|
||||
fun <E : Event> Class<E>._subscribeEventForJaptOnly(
|
||||
internal fun <E : Event> Class<E>._subscribeEventForJaptOnly(
|
||||
scope: CoroutineScope,
|
||||
onEvent: Function<E, ListeningStatus>
|
||||
): Listener<E> {
|
||||
@ -35,9 +34,8 @@ fun <E : Event> Class<E>._subscribeEventForJaptOnly(
|
||||
) { withContext(Dispatchers.IO) { onEvent.apply(it) } })
|
||||
}
|
||||
|
||||
@MiraiInternalAPI
|
||||
@Suppress("FunctionName")
|
||||
fun <E : Event> Class<E>._subscribeEventForJaptOnly(scope: CoroutineScope, onEvent: Consumer<E>): Listener<E> {
|
||||
internal fun <E : Event> Class<E>._subscribeEventForJaptOnly(scope: CoroutineScope, onEvent: Consumer<E>): Listener<E> {
|
||||
return this.kotlin.subscribeInternal(
|
||||
scope.Handler(
|
||||
EmptyCoroutineContext,
|
||||
|
Loading…
Reference in New Issue
Block a user