media-type
Version:
Parse and validate RFC6838/RFC9694 media types, anything from 'text/plain' to 'application/vnd.company.app.entity-v2+xml;charset=utf8'
38 lines (33 loc) • 694 B
TypeScript
/*!
Copyright 2013 Lovell Fuller and others.
SPDX-License-Identifier: Apache-2.0
*/
export class MediaType {
static parse(mediaType: string): MediaType | null;
constructor(mediaType?: string);
essence: string;
type:
| "application"
| "audio"
| "font"
| "image"
| "haptics"
| "message"
| "model"
| "multipart"
| "text"
| "video"
| "*";
subtype: string;
subtypeFacets: string[];
suffix: string | null;
parameters: Map<string, string>;
hasSuffix(): boolean;
isHTML(): boolean;
isJavaScript(): boolean;
isXML(): boolean;
isPersonal(): boolean;
isExperimental(): boolean;
isVendor(): boolean;
toString(): string;
}