/** * Returns the most relevant extension for the given media type, or `undefined` * if no extension can be found. * * Extensions are returned without a leading `.`. * * @param type The media type to get the extension for. * * @returns The extension for the given media type, or `undefined` if no * extension is found. * * @example Usage * ```ts * import { extension } from "../media-types/extension.ts"; * import { assertEquals } from "../assert/mod.ts"; * * assertEquals(extension("text/plain"), "txt"); * assertEquals(extension("application/json"), "json"); * assertEquals(extension("text/html; charset=UTF-8"), "html"); * assertEquals(extension("application/foo"), undefined); * ``` */ export declare function extension(type: string): string | undefined;