-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/

-- | Basic mime-type handling types and functions
--   
--   API docs and the README are available at
--   http://www.stackage.org/package/mime-types.
@package mime-types
@version 0.1.2.0

module Network.Mime

-- | Look up a mime type from the given mime map and default mime type.
mimeByExt :: MimeMap -> MimeType -> FileName -> MimeType

-- | mimeByExt applied to defaultMimeType and
--   defaultMimeMap.
defaultMimeLookup :: FileName -> MimeType

-- | The default fallback mime type "application/octet-stream".
defaultMimeType :: MimeType

-- | A default mapping from filename extension to mime type.
--   
--   Generated from the Apache and nginx mime.types files.
defaultMimeMap :: MimeMap

-- | A mapping of MimeType to a set of Extensions.
defaultExtensionMap :: ExtensionMap

-- | Get a list of all of the file name extensions.
--   
--   
--   fileNameExtensions "foo.tar.gz" == ["tar.gz", "gz"]
--   
fileNameExtensions :: FileName -> [Extension]

-- | The filename component of a filepath, leaving off the directory but
--   keeping all extensions.
type FileName = Text

-- | Individual mime type for be served over the wire.
type MimeType = ByteString

-- | Maps extensions to mime types.
type MimeMap = Map Extension MimeType

-- | Path extension. May include multiple components, e.g. tar.gz
type Extension = Text

-- | Maps mime types to extensions. The list of extensions is in
--   alphabetical order.
type ExtensionMap = Map MimeType [Extension]
