mirai/backend/mirai-console/src/MiraiConsoleFrontEndDescription.kt

51 lines
1.3 KiB
Kotlin
Raw Normal View History

/*
2020-08-23 17:46:51 +08:00
* Copyright 2019-2020 Mamoe Technologies and contributors.
*
* 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证.
2020-10-28 13:35:15 +08:00
* Use of this source code is governed by the GNU AFFERO GENERAL PUBLIC LICENSE version 3 license that can be found through the following link.
*
* https://github.com/mamoe/mirai/blob/master/LICENSE
*/
2020-11-08 09:52:29 +08:00
@file:Suppress("unused")
package net.mamoe.mirai.console
2020-09-20 18:01:02 +08:00
import net.mamoe.mirai.console.util.SemVersion
2020-11-08 09:52:29 +08:00
import net.mamoe.mirai.utils.MiraiExperimentalAPI
2020-09-20 18:01:02 +08:00
/**
* 有关前端实现的信息
*/
public interface MiraiConsoleFrontEndDescription {
/**
* 此前端实现的名称
*/
public val name: String
/**
* 此前端实现的提供者
*/
public val vendor: String
/**
* 此前端实现的名称
*/
2020-09-20 18:01:02 +08:00
public val version: SemVersion
/**
* 兼容的 [MiraiConsole] 后端版本号
*
* `Semver("[1.0.0, 2.0.0)", Semver.SemverType.IVY)`
*
* 返回 `null` 表示禁止 [MiraiConsole] 后端检查版本兼容性.
*/
2020-11-08 09:52:29 +08:00
@MiraiExperimentalAPI
2020-09-20 18:01:02 +08:00
public val compatibleBackendVersion: SemVersion? get() = null
/**
* 返回显示在 [MiraiConsole] 启动时的信息
*/
public fun render(): String = "Frontend ${name}: version ${version}, provided by $vendor"
}