Package-level declarations

Types

Link copied to clipboard
data class CustomMimeType(val raw: String) : MimeType

A custom implementation of MimeType that wraps a raw MIME type string. Use this when you need to work with MIME types that aren't defined in the standard set.

Link copied to clipboard
@Serializable(with = MimeTypeSerializer::class)
sealed class KnownMimeTypes : MimeType
Link copied to clipboard
@Serializable(with = MimeTypeSerializer::class)
interface MimeType

Represents a MIME type (Multipurpose Internet Mail Extensions type). A MIME type is a standard way to indicate the nature and format of a document, file, or assortment of bytes.

Link copied to clipboard
@Serializer(forClass = MimeType::class)
object MimeTypeSerializer : KSerializer<MimeType>

Serializer for MimeType that serializes MIME types as their raw string representation. Uses the mimeType factory function to create appropriate MimeType instances during deserialization, which will return known MIME types when available or create CustomMimeType for unknown types.

Properties

Link copied to clipboard

Functions

Link copied to clipboard
Link copied to clipboard
inline fun getMimeType(stringWithExtension: String, selector: (Array<MimeType>) -> MimeType? = { it.firstOrNull() }): MimeType?
Link copied to clipboard
inline fun getMimeTypeOrAny(stringWithExtension: String, selector: (Array<MimeType>) -> MimeType? = { it.firstOrNull() }): MimeType
Link copied to clipboard