mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Add definition for mediaType() in @types/accept
This commit is contained in:
parent
b35434fe6f
commit
c4a9538c17
@ -14,6 +14,8 @@ accept.language("en;q=0.7, en-GB;q=0.8", ["en-gb"]); // language === "en-GB"
|
||||
const languages = accept.languages("da, en;q=0.7, en-GB;q=0.8"); // languages === ["da", "en-GB", "en"]
|
||||
languages.lastIndexOf('');
|
||||
|
||||
accept.mediaType("text/plain, application/json;q=0.5, text/html, */*;q=0.1");
|
||||
accept.mediaType("text/plain, application/json;q=0.5, text/html, */*;q=0.1", ["application/json", "text/html"]);
|
||||
const mediaTypes = accept.mediaTypes("text/plain, application/json;q=0.5, text/html, */*;q=0.1");
|
||||
// mediaTypes === ["text/plain", "text/html", "application/json", "*/*"]
|
||||
mediaTypes.lastIndexOf('');
|
||||
|
||||
1
types/accept/index.d.ts
vendored
1
types/accept/index.d.ts
vendored
@ -10,6 +10,7 @@ export function encoding(encodingHeader?: string, preferences?: string[]): strin
|
||||
export function encodings(encodingHeader?: string): string[];
|
||||
export function language(languageHeader?: string, preferences?: string[]): string;
|
||||
export function languages(languageHeader?: string): string[];
|
||||
export function mediaType(mediaTypeHeader?: string, preferences?: string[]): string;
|
||||
export function mediaTypes(mediaTypeHeader?: string): string[];
|
||||
export function parseAll(
|
||||
headers: Record<string, string | string[] | undefined>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user