Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
48 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters