# Package-level declarations

## Types

CustomMimeType
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.

KnownMimeTypes
Link copied to clipboard
@Serializable(with = MimeTypeSerializer::class )
sealed class KnownMimeTypes : MimeType
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.

MimeTypeSerializer
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

knownMimeTypesMap
Link copied to clipboard
val knownMimeTypesMap : Map < String , MimeType >
mimeTypesByExtensions
Link copied to clipboard
val mimeTypesByExtensions : Map < String , Array < MimeType >>

## Functions

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