mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-27 00:20:19 +08:00
Add getInstance for front-end implementers
This commit is contained in:
parent
9e6b76b6cb
commit
cd6e78d36c
@ -175,6 +175,15 @@ public interface MiraiConsoleImplementation : CoroutineScope {
|
|||||||
internal lateinit var instance: MiraiConsoleImplementation
|
internal lateinit var instance: MiraiConsoleImplementation
|
||||||
private val initLock = ReentrantLock()
|
private val initLock = ReentrantLock()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 可由前端调用, 获取当前的 [MiraiConsoleImplementation] 实例
|
||||||
|
*
|
||||||
|
* 必须在 [start] 之后才能使用.
|
||||||
|
*/
|
||||||
|
@JvmStatic
|
||||||
|
@ConsoleFrontEndImplementation
|
||||||
|
public fun getInstance(): MiraiConsoleImplementation = instance
|
||||||
|
|
||||||
/** 由前端调用, 初始化 [MiraiConsole] 实例并启动 */
|
/** 由前端调用, 初始化 [MiraiConsole] 实例并启动 */
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
@ConsoleFrontEndImplementation
|
@ConsoleFrontEndImplementation
|
||||||
|
Loading…
Reference in New Issue
Block a user