All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.app.bsky.richtext.facet.kt Maven / Gradle / Ivy

The newest version!
@file:Suppress("DEPRECATION")

package app.bsky.richtext

import kotlin.Suppress
import kotlin.collections.List
import kotlin.jvm.JvmInline
import kotlinx.serialization.KSerializer
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import sh.christian.ozone.api.model.JsonContent
import sh.christian.ozone.api.runtime.valueClassSerializer

@Serializable
public sealed interface FacetFeatureUnion {
  public class MentionSerializer : KSerializer by valueClassSerializer(
    serialName = "app.bsky.richtext.facet#mention",
    constructor = ::Mention,
    valueProvider = Mention::value,
    valueSerializerProvider = { FacetMention.serializer() },
  )

  @JvmInline
  @Serializable(with = MentionSerializer::class)
  @SerialName("app.bsky.richtext.facet#mention")
  public value class Mention(
    public val `value`: FacetMention,
  ) : FacetFeatureUnion

  public class LinkSerializer : KSerializer by valueClassSerializer(
    serialName = "app.bsky.richtext.facet#link",
    constructor = ::Link,
    valueProvider = Link::value,
    valueSerializerProvider = { FacetLink.serializer() },
  )

  @JvmInline
  @Serializable(with = LinkSerializer::class)
  @SerialName("app.bsky.richtext.facet#link")
  public value class Link(
    public val `value`: FacetLink,
  ) : FacetFeatureUnion

  public class TagSerializer : KSerializer by valueClassSerializer(
    serialName = "app.bsky.richtext.facet#tag",
    constructor = ::Tag,
    valueProvider = Tag::value,
    valueSerializerProvider = { FacetTag.serializer() },
  )

  @JvmInline
  @Serializable(with = TagSerializer::class)
  @SerialName("app.bsky.richtext.facet#tag")
  public value class Tag(
    public val `value`: FacetTag,
  ) : FacetFeatureUnion

  @JvmInline
  @Serializable
  public value class Unknown(
    public val `value`: JsonContent,
  ) : FacetFeatureUnion
}

/**
 * Annotation of a sub-string within rich text.
 */
@Serializable
public data class Facet(
  public val index: FacetByteSlice,
  public val features: List,
)




© 2015 - 2024 Weber Informatics LLC | Privacy Policy