2020-11-05 10:53:26 +00:00
|
|
|
package dev.inmo.tgbotapi.CommonAbstracts
|
|
|
|
|
2021-05-29 08:23:25 +00:00
|
|
|
import dev.inmo.tgbotapi.types.MessageEntity.textsources.TextSource
|
2020-11-05 10:53:26 +00:00
|
|
|
import dev.inmo.tgbotapi.types.ParseMode.ParseMode
|
|
|
|
|
|
|
|
interface Texted {
|
|
|
|
val text: String?
|
|
|
|
}
|
2021-04-29 05:52:38 +00:00
|
|
|
interface TextedWithTextSources : Texted {
|
|
|
|
/**
|
|
|
|
* Full list of [TextSource] built from source[TextedInput.textEntities]
|
|
|
|
*/
|
2021-05-29 08:23:25 +00:00
|
|
|
val textSources: List<dev.inmo.tgbotapi.types.MessageEntity.textsources.TextSource>?
|
2021-04-29 05:52:38 +00:00
|
|
|
}
|
2020-11-05 10:53:26 +00:00
|
|
|
|
|
|
|
interface ParsableOutput : Texted {
|
|
|
|
val parseMode: ParseMode?
|
|
|
|
}
|
|
|
|
|
2021-04-29 05:52:38 +00:00
|
|
|
interface EntitiesOutput : TextedWithTextSources {
|
2021-05-29 08:23:25 +00:00
|
|
|
val entities: List<dev.inmo.tgbotapi.types.MessageEntity.textsources.TextSource>?
|
2021-04-29 05:52:38 +00:00
|
|
|
get() = textSources
|
2020-11-05 10:53:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
interface TextedOutput : ParsableOutput, EntitiesOutput
|
|
|
|
|
2021-04-29 05:52:38 +00:00
|
|
|
interface TextedInput : TextedWithTextSources {
|
|
|
|
override val textSources: List<TextSource>
|
2020-11-05 10:53:26 +00:00
|
|
|
/**
|
2021-01-06 17:06:48 +00:00
|
|
|
* Here must be full list of entities. This list must contains [TextPart]s with
|
|
|
|
* [dev.inmo.tgbotapi.types.MessageEntity.textsources.RegularTextSource] in case if source text contains parts of
|
|
|
|
* regular text
|
2020-11-05 10:53:26 +00:00
|
|
|
*/
|
|
|
|
val textEntities: List<TextPart>
|
2021-04-27 10:08:36 +00:00
|
|
|
get() = textSources.toTextParts()
|
2020-11-05 10:53:26 +00:00
|
|
|
}
|