Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "index"

Index

Variables

Functions

Variables

Const MIME_TYPES

MIME_TYPES: IObjectOf<string[]> = ((defs: any) => {const res: IObjectOf<string[]> = {};for (let groupID in defs) {const group = defs[groupID];for (let type in group) {const mime = groupID + "/" + type;for (let e of group[type].split(",")) {const isLowPri = e[0] === "*";const ext = isLowPri ? e.substr(1) : e;let coll = res[ext];!coll && (coll = res[ext] = []);isLowPri ? coll.push(mime) : coll.unshift(mime);}}}return res;})({application: {"andrew-inset": "ez",applixware: "aw","atom+xml": "atom","atomcat+xml": "atomcat","atomsvc+xml": "atomsvc",bdoc: "bdoc","ccxml+xml": "ccxml","cdmi-capability": "cdmia","cdmi-container": "cdmic","cdmi-domain": "cdmid","cdmi-object": "cdmio","cdmi-queue": "cdmiq","cu-seeme": "cu","dash+xml": "mpd","davmount+xml": "davmount","docbook+xml": "dbk","dssc+der": "dssc","dssc+xml": "xdssc",ecmascript: "ecma,es","emma+xml": "emma","epub+zip": "epub",exi: "exi","font-tdpfr": "pfr","geo+json": "geojson","gml+xml": "gml","gpx+xml": "gpx",gxf: "gxf",gzip: "gz",hjson: "hjson",hyperstudio: "stk","inkml+xml": "ink,inkml",ipfix: "ipfix","java-archive": "jar,war,ear","java-serialized-object": "ser","java-vm": "class",javascript: "js,mjs",json: "json,map",json5: "json5","jsonml+json": "jsonml","ld+json": "jsonld","lost+xml": "lostxml","mac-binhex40": "hqx","mac-compactpro": "cpt","mads+xml": "mads","manifest+json": "webmanifest",marc: "mrc","marcxml+xml": "mrcx",mathematica: "ma,nb,mb","mathml+xml": "mathml",mbox: "mbox","mediaservercontrol+xml": "mscml","metalink+xml": "metalink","metalink4+xml": "meta4","mets+xml": "mets","mods+xml": "mods",mp21: "m21,mp21",mp4: "mp4s,m4p",msword: "doc,dot",mxf: "mxf","n-quads": "nq","n-triples": "nt","octet-stream":"bin,dms,lrf,mar,so,dist,distz,pkg,bpk,dump,elc,deploy,exe,dll,deb,dmg,iso,img,msi,msp,msm,buffer",oda: "oda","oebps-package+xml": "opf",ogg: "ogx","omdoc+xml": "omdoc",onenote: "onetoc,onetoc2,onetmp,onepkg",oxps: "oxps","patch-ops-error+xml": "xer",pdf: "pdf","pgp-encrypted": "pgp","pgp-signature": "asc,sig","pics-rules": "prf",pkcs10: "p10","pkcs7-mime": "p7m,p7c","pkcs7-signature": "p7s",pkcs8: "p8","pkix-attr-cert": "ac","pkix-cert": "cer","pkix-crl": "crl","pkix-pkipath": "pkipath",pkixcmp: "pki","pls+xml": "pls",postscript: "ai,eps,ps","pskc+xml": "pskcxml","raml+yaml": "raml","rdf+xml": "rdf,owl","reginfo+xml": "rif","relax-ng-compact-syntax": "rnc","resource-lists+xml": "rl","resource-lists-diff+xml": "rld","rls-services+xml": "rs","rpki-ghostbusters": "gbr","rpki-manifest": "mft","rpki-roa": "roa","rsd+xml": "rsd","rss+xml": "rss",rtf: "rtf","sbml+xml": "sbml","scvp-cv-request": "scq","scvp-cv-response": "scs","scvp-vp-request": "spq","scvp-vp-response": "spp",sdp: "sdp","set-payment-initiation": "setpay","set-registration-initiation": "setreg","shf+xml": "shf",sieve: "siv,sieve","smil+xml": "smi,smil","sparql-query": "rq","sparql-results+xml": "srx",srgs: "gram","srgs+xml": "grxml","sru+xml": "sru","ssdl+xml": "ssdl","ssml+xml": "ssml","tei+xml": "tei,teicorpus","thraud+xml": "tfi","timestamped-data": "tsd","voicexml+xml": "vxml",wasm: "wasm",widget: "wgt",winhlp: "hlp","wsdl+xml": "wsdl","wspolicy+xml": "wspolicy","x-bzip2": "bz2","xaml+xml": "xaml","xcap-diff+xml": "xdf","xenc+xml": "xenc","xhtml+xml": "xhtml,xht",xml: "xml,xsl,xsd,rng","xml-dtd": "dtd","xop+xml": "xop","xproc+xml": "xpl","xslt+xml": "xslt","xspf+xml": "xspf","xv+xml": "mxml,xhvml,xvml,xvm",yang: "yang","yin+xml": "yin",zip: "zip",},audio: {"3gpp": "*3gpp",aac: "aac",adpcm: "adp",basic: "au,snd",midi: "mid,midi,kar,rmi",mp3: "*mp3",mp4: "m4a,mp4a",mpeg: "mpga,mp2,mp2a,mp3,m2a,m3a",ogg: "oga,ogg,spx",s3m: "s3m",silk: "sil",wav: "wav",wave: "*wav",webm: "weba",xm: "xm",},font: {collection: "ttc",otf: "otf",ttf: "ttf",woff: "woff",woff2: "woff2",},image: {aces: "exr",apng: "apng",bmp: "bmp",cgm: "cgm","dicom-rle": "drle",emf: "emf",fits: "fits",g3fax: "g3",gif: "gif",heic: "heic","heic-sequence": "heics",heif: "heif","heif-sequence": "heifs",ief: "ief",jls: "jls",jp2: "jp2,jpg2",jpeg: "jpeg,jpg,jpe",jpm: "jpm",jpx: "jpx,jpf",jxr: "jxr",ktx: "ktx",png: "png",sgi: "sgi","svg+xml": "svg,svgz",t38: "t38",tiff: "tif,tiff","tiff-fx": "tfx",webp: "webp",wmf: "wmf",},message: {"disposition-notification": "disposition-notification",global: "u8msg","global-delivery-status": "u8dsn","global-disposition-notification": "u8mdn","global-headers": "u8hdr",rfc822: "eml,mime",},model: {"3mf": "3mf","gltf+json": "gltf","gltf-binary": "glb",iges: "igs,iges",mesh: "msh,mesh,silo",mtl: "mtl",obj: "obj",stl: "stl",vrml: "wrl,vrml","x3d+binary": "*x3db,x3dbz","x3d+fastinfoset": "x3db","x3d+vrml": "*x3dv,x3dvz","x3d+xml": "x3d,x3dz","x3d-vrml": "x3dv",},text: {"cache-manifest": "appcache,manifest",calendar: "ics,ifb",coffeescript: "coffee,litcoffee",css: "css",csv: "csv",html: "html,htm,shtml",jade: "jade",jsx: "jsx",less: "less",markdown: "markdown,md",mathml: "mml",mdx: "mdx",n3: "n3",plain: "txt,text,conf,def,list,log,in,ini",richtext: "rtx",rtf: "*rtf",sgml: "sgml,sgm",shex: "shex",slim: "slim,slm",stylus: "stylus,styl","tab-separated-values": "tsv",troff: "t,tr,roff,man,me,ms",turtle: "ttl","uri-list": "uri,uris,urls",vcard: "vcard",vtt: "vtt",xml: "*xml",yaml: "yaml,yml",},video: {"3gpp": "3gp,3gpp","3gpp2": "3g2",h261: "h261",h263: "h263",h264: "h264",jpeg: "jpgv",jpm: "*jpm,jpgm",mj2: "mj2,mjp2",mp2t: "ts",mp4: "mp4,mp4v,mpg4",mpeg: "mpeg,mpg,mpe,m1v,m2v",ogg: "ogv",quicktime: "qt,mov",webm: "webm","x-msvideo": "avi",},})

Functions

Const preferredType

  • preferredType(ext: string, fallback?: string): string
  • Returns preferred MIME type for given file extension or, if no match is available, the fallback MIME type (default: application/octet-stream).

    Parameters

    • ext: string
    • Default value fallback: string = MIME_TYPES.bin[0]

    Returns string

Generated using TypeDoc