Package-level declarations

Types

Link copied to clipboard
internal data class DownloadedImage(val bytes: ByteArray, val mimeType: String)
Link copied to clipboard
internal object ExclusionRanges

Computes ranges to exclude from link preview detection (mentions and markdown links).

Link copied to clipboard
internal data class ImageMetadata(val width: Int, val height: Int, val mimeType: String)
Link copied to clipboard
internal interface LinkPreviewMapper
Link copied to clipboard
internal class LinkPreviewMapperImpl(encryptionAlgorithmMapper: EncryptionAlgorithmMapper = MapperProvider.encryptionAlgorithmMapper()) : LinkPreviewMapper
Link copied to clipboard
internal interface LinkPreviewRepository

Repository for link preview data fetching and parsing.

Link copied to clipboard
internal class LinkPreviewRepositoryImpl(httpClient: <Error class: unknown class>, kaliumFileSystem: KaliumFileSystem, resolveHostAddresses: suspend (String) -> List<String> = ::resolvePreviewHostAddresses) : LinkPreviewRepository

Default implementation of LinkPreviewRepository.

Link copied to clipboard
internal data class OpenGraphData(val title: String?, val type: String = "website", val url: String?, val description: String?, val imageUrls: List<String> = emptyList(), val siteName: String?)

Internal parsed Open Graph data structure.

Link copied to clipboard
internal object OpenGraphScanner

Scans HTML head for Open Graph metadata using DOM-based parsing (Ksoup).

Link copied to clipboard
internal object PreviewBlacklist

Blocks link previews for URLs from certain hosts (e.g., video/music streaming services). Uses substring matching for simplicity and to catch variations (e.g., youtu.be, youtube.com).

Link copied to clipboard
internal object UrlDetector

Detects URLs in text using the AOSP Patterns.WEB_URL regex, ported to commonMain for iOS parity.

Properties

Link copied to clipboard
internal const val MAX_PREVIEW_ASSET_NAME_LENGTH: Int = 255
Link copied to clipboard
internal const val MAX_PREVIEW_DESCRIPTION_LENGTH: Int
Link copied to clipboard
internal const val MAX_PREVIEW_SITE_NAME_LENGTH: Int = 120
Link copied to clipboard
internal const val MAX_PREVIEW_TITLE_LENGTH: Int = 300
Link copied to clipboard
internal const val MAX_PREVIEW_URL_LENGTH: Int

Functions

Link copied to clipboard
internal actual fun normalizePreviewUnicode(input: String): String
internal actual fun normalizePreviewUnicode(input: String): String
internal expect fun normalizePreviewUnicode(input: String): String
internal actual fun normalizePreviewUnicode(input: String): String
Link copied to clipboard
internal actual fun readImageMetadata(bytes: ByteArray, fallbackMimeType: String): ImageMetadata?
internal actual fun readImageMetadata(bytes: ByteArray, fallbackMimeType: String): ImageMetadata?
internal expect fun readImageMetadata(bytes: ByteArray, fallbackMimeType: String): ImageMetadata?
internal actual fun readImageMetadata(bytes: ByteArray, fallbackMimeType: String): ImageMetadata?
Link copied to clipboard
internal actual suspend fun resolvePreviewHostAddresses(host: String): List<String>
internal actual suspend fun resolvePreviewHostAddresses(host: String): List<String>
internal expect suspend fun resolvePreviewHostAddresses(host: String): List<String>
internal actual suspend fun resolvePreviewHostAddresses(host: String): List<String>
Link copied to clipboard
internal fun sanitizePreviewText(input: String?, maxLength: Int, collapseWhitespace: Boolean = true): String?