mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-10 18:40:15 +08:00
Update docs
This commit is contained in:
parent
73c28c6cbf
commit
dee8e44110
@ -51,7 +51,7 @@ import kotlin.reflect.full.findAnnotation
|
||||
*
|
||||
* object MyPluginData : AutoSavePluginData() {
|
||||
* var list: MutableList<String> by value(mutableListOf("a", "b")) // mutableListOf("a", "b") 是初始值, 可以省略
|
||||
* val custom: Map<Long, CustomData> by value() // 使用 kotlinx-serialization 序列化的类型. (目前还不支持)
|
||||
* val custom: Map<Long, CustomData> by value() // 使用 kotlinx-serialization 序列化的类型.
|
||||
* var long: Long by value(0) // 允许 var
|
||||
* var int by value(0) // 可以使用类型推断, 但更推荐使用 `var long: Long by value(0)` 这种定义方式.
|
||||
*
|
||||
@ -59,7 +59,7 @@ import kotlin.reflect.full.findAnnotation
|
||||
* val botToLongMap: MutableMap<Bot, Long> by value<MutableMap<Long, Long>>().mapKeys(Bot::getInstance, Bot::id)
|
||||
* }
|
||||
*
|
||||
* @Serializable
|
||||
* @Serializable // kotlinx.serialization: https://github.com/Kotlin/kotlinx.serialization
|
||||
* data class CustomData(
|
||||
* // ...
|
||||
* )
|
||||
|
Loading…
Reference in New Issue
Block a user