Skip to content

Commit

Permalink
Merge b572ccf into 83e91a5
Browse files Browse the repository at this point in the history
  • Loading branch information
Borewit committed Dec 1, 2016
2 parents 83e91a5 + b572ccf commit b99956b
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 1 deletion.
46 changes: 46 additions & 0 deletions index.d.ts
@@ -0,0 +1,46 @@
/**
* Get the default charset for a MIME type.
*
* @param {string} mimeType MIME type
* @return {string|boolean} the default charset or false if not found
*/
export function charset (mimeType: string): string

/**
* Create a full Content-Type header given a MIME type or extension.
*
* @param {string} type MIME type or extension
* @return {boolean|string} Content-Type header
*/
export function contentType (type: string): string

/**
* Get the default extension for a MIME type.
*
* @param {string} mimeType MIME type
* @return {boolean|string} the extension or false if not found
*/
export function extension (mimeType: string): string

/**
* Lookup the MIME type for a file path/extension.
*
* @param {string} path
* @return {string|boolean} MIME type, or false if not found
*/
export function lookup (path: string): string

/**
* charsets.lookup redirects to lookup
*/
export var charsets: {lookup: (mimeType: string) => string}

/**
* File extensions indexed by MIME type
*/
export var extensions: { [extension: string]: string };

/**
* MIME types indexed by (lower case) file extension
*/
export var types: { [contentType: string]: string };
3 changes: 2 additions & 1 deletion package.json
Expand Up @@ -27,7 +27,8 @@
"files": [
"HISTORY.md",
"LICENSE",
"index.js"
"index.js",
"index.d.ts"
],
"engines": {
"node": ">= 0.6"
Expand Down

0 comments on commit b99956b

Please sign in to comment.