/** * Parses the media type and any optional parameters, per * {@link https://www.rfc-editor.org/rfc/rfc1521.html | RFC 1521}. * * Media types are the values in `Content-Type` and `Content-Disposition` * headers. On success the function returns a tuple where the first element is * the media type and the second element is the optional parameters or * `undefined` if there are none. * * The function will throw if the parsed value is invalid. * * The returned media type will be normalized to be lower case, and returned * params keys will be normalized to lower case, but preserves the casing of * the value. * * @param type The media type to parse. * * @returns A tuple where the first element is the media type and the second * element is the optional parameters or `undefined` if there are none. * * @example Usage * ```ts * import { parseMediaType } from "../media-types/parse_media_type.ts"; * import { assertEquals } from "../assert/mod.ts"; * * assertEquals(parseMediaType("application/JSON"), ["application/json", undefined]); * assertEquals(parseMediaType("text/html; charset=UTF-8"), ["text/html", { charset: "UTF-8" }]); * ``` */ export declare function parseMediaType( type: string, ): [mediaType: string, params: Record | undefined];