audioWave
Waveform Audio Format
static var audioWave: MediaType { get }
Waveform Audio Format
static var audioWave: MediaType { get }
import Hummingbird
struct MediaType
Define media type of file
init?(from header: String)
Construct MediaType
from header value
init(from decoder: any Decoder) throws
init(type: MediaType.Category, subType: String = "*", parameter: (String, String)? = nil)
Initialize MediaType
static var application: MediaType { get }
static var application7z: MediaType { get }
7-zip archive
static var applicationAbiWord: MediaType { get }
AbiWord document
static var applicationAmzKindleEBook: MediaType { get }
Amazon Kindle eBook format
static var applicationArc: MediaType { get }
Archive document (multiple files embedded)
static var applicationBinary: MediaType { get }
Any kind of binary data
static var applicationBzip: MediaType { get }
BZip archive
static var applicationBzip2: MediaType { get }
BZip2 archive
static var applicationCsh: MediaType { get }
C-Shell script
static var applicationDocx: MediaType { get }
Microsoft Word (OpenXML)
static var applicationEot: MediaType { get }
MS Embedded OpenType fonts
static var applicationEpub: MediaType { get }
Electronic publication (EPUB)
static var applicationGzip: MediaType { get }
GZip Compressed Archive
static var applicationJar: MediaType { get }
Java Archive (JAR)
static var applicationJson: MediaType { get }
JSON format
static var applicationJsonLD: MediaType { get }
JSON-LD format
static var applicationManifest: MediaType { get }
Manifest
static var applicationMpkg: MediaType { get }
Apple Installer Package
static var applicationMsword: MediaType { get }
Microsoft Word
static var applicationOdp: MediaType { get }
OpenDocument presentation document
static var applicationOds: MediaType { get }
OpenDocument spreadsheet document
static var applicationOdt: MediaType { get }
OpenDocument text document
static var applicationOgg: MediaType { get }
OGG
static var applicationPdf: MediaType { get }
Adobe Portable Document Format
static var applicationPhp: MediaType { get }
Hypertext Preprocessor
static var applicationPpt: MediaType { get }
Microsoft PowerPoint
static var applicationPptx: MediaType { get }
Microsoft PowerPoint (OpenXML)
static var applicationRar: MediaType { get }
RAR archive
static var applicationRtf: MediaType { get }
Rich Text Format (RTF)
static var applicationSh: MediaType { get }
Bourne shell script
static var applicationSwf: MediaType { get }
Small web format (SWF) or Adobe Flash document
static var applicationTar: MediaType { get }
Tape Archive (TAR)
static var applicationUrlEncoded: MediaType { get }
URL encoded form data
static var applicationVsd: MediaType { get }
Microsoft Visio
static var applicationWasm: MediaType { get }
WebAssembly
static var applicationXhtml: MediaType { get }
XHTML
static var applicationXls: MediaType { get }
Microsoft Excel
static var applicationXlsx: MediaType { get }
Microsoft Excel (OpenXML)
static var applicationXml: MediaType { get }
XML
static var applicationZip: MediaType { get }
ZIP archive
static var audio: MediaType { get }
static var audio3g2: MediaType { get }
3GPP2 audio/video container
static var audio3gp: MediaType { get }
3GPP audio/video container
static var audioAac: MediaType { get }
AAC audio
static var audioMidi: MediaType { get }
Musical Instrument Digital Interface (MIDI)
static var audioMpeg: MediaType { get }
MP3 audio
static var audioOgg: MediaType { get }
OGG audio
static var audioOpus: MediaType { get }
Opus audio
static var audioWebm: MediaType { get }
WEBM audio
static var example: MediaType { get }
static var font: MediaType { get }
static var fontOtf: MediaType { get }
OpenType font
static var fontTtf: MediaType { get }
TrueType Font
static var fontWoff: MediaType { get }
Web Open Font Format (WOFF)
static var fontWoff2: MediaType { get }
Web Open Font Format (WOFF)
static var image: MediaType { get }
static var imageBmp: MediaType { get }
Windows OS/2 Bitmap Graphics
static var imageGif: MediaType { get }
Graphics Interchange Format (GIF)
static var imageIco: MediaType { get }
Icon format
static var imageJpeg: MediaType { get }
JPEG images
static var imagePng: MediaType { get }
Portable Network Graphics
static var imageSvg: MediaType { get }
Scalable Vector Graphics (SVG)
static var imageTiff: MediaType { get }
Tagged Image File Format (TIFF)
static var imageWebp: MediaType { get }
WEBP image
static var message: MediaType { get }
static var model: MediaType { get }
static var multipart: MediaType { get }
static var multipartForm: MediaType { get }
Multipart formdata
static var text: MediaType { get }
static var textCss: MediaType { get }
Cascading Style Sheets (CSS)
static var textCsv: MediaType { get }
Comma-separated values (CSV)
static var textHtml: MediaType { get }
HyperText Markup Language (HTML)
static var textICalendar: MediaType { get }
iCalendar format
static var textJavascript: MediaType { get }
JavaScript
static var textPlain: MediaType { get }
Text, (generally ASCII or ISO 8859-n)
static var video: MediaType { get }
static var video3g2: MediaType { get }
3GPP2 audio/video container
static var video3gp: MediaType { get }
3GPP audio/video container
static var videoMp4: MediaType { get }
AVI: Audio Video Interleave
static var videoMpeg: MediaType { get }
MPEG Video
static var videoOgg: MediaType { get }
OGG video
static var videoTs: MediaType { get }
MPEG transport stream
static var videoWebm: MediaType { get }
WEBM video
static func getMediaType(forExtension extension: MediaType.FileExtension) -> MediaType?
Get media type from a file extension
static func getMediaType(forExtension extension: String) -> MediaType?
Get media type from a file extension
var description: String { get }
Output
let parameter: (name: String, value: String)?
optional parameter
let subType: String
exact kind of data specified
let type: MediaType.Category
general category
static func ~= (lhs: MediaType, rhs: MediaType) -> Bool
func encode(to encoder: any Encoder) throws
func isType(_ type: MediaType) -> Bool
Return if media type matches the input
func withParameter(name: String, value: String) -> MediaType
Return media type with new parameter
struct Category
Media type categories
struct FileExtension
Type safe wrapper for file extensions. Additionally provides case insensitive comparison.