mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-10 18:40:15 +08:00
Add Java bridge for implementing ConsoleInput
This commit is contained in:
parent
7d9d181002
commit
aa3c8baccb
@ -118,6 +118,9 @@ public interface MiraiConsoleImplementation : CoroutineScope {
|
||||
withContext(Dispatchers.IO) { sendMessageJ(message) }
|
||||
}
|
||||
|
||||
/**
|
||||
* [ConsoleCommandSender]
|
||||
*/
|
||||
public val consoleCommandSender: ConsoleCommandSenderImpl
|
||||
|
||||
public val dataStorageForJvmPluginLoader: PluginDataStorage
|
||||
@ -127,9 +130,27 @@ public interface MiraiConsoleImplementation : CoroutineScope {
|
||||
|
||||
/**
|
||||
* @see ConsoleInput 的实现
|
||||
* @see JConsoleInput
|
||||
*/
|
||||
public val consoleInput: ConsoleInput
|
||||
|
||||
/**
|
||||
* 供 Java 用户实现 [ConsoleInput]
|
||||
*/
|
||||
@Suppress("INAPPLICABLE_JVM_NAME")
|
||||
@ConsoleFrontEndImplementation
|
||||
public interface JConsoleInput : ConsoleInput {
|
||||
/**
|
||||
* @see ConsoleInput.requestInput
|
||||
*/
|
||||
@JvmName("requestInput")
|
||||
public fun requestInputJ(hint: String): String
|
||||
|
||||
override suspend fun requestInput(hint: String): String {
|
||||
return withContext(Dispatchers.IO) { requestInputJ(hint) }
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建一个 [LoginSolver]
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user