npm.io
1.5.8 • Published 1 year ago

@types/accept-language-parser

Licence
MIT
Version
1.5.8
Deps
0
Size
4 kB
Vulns
0
Weekly
0
Stars
51.4K

Installation

npm install --save @types/accept-language-parser

Summary

This package contains type definitions for accept-language-parser (https://github.com/opentable/accept-language-parser).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/accept-language-parser.

index.d.ts

// https://github.com/opentable/accept-language-parser/blob/v1.5.0/index.js

export function parse(acceptLanguage?: string): Language[];
export function pick<T extends string>(
    supportedLanguages: readonly T[],
    acceptLanguage: string | Language[],
    options?: PickOptions,
): T | null;

export interface Language {
    code: string;
    script?: string | null | undefined;
    region?: string | undefined;
    quality: number;
}

export interface PickOptions {
    loose?: boolean | undefined;
}

Additional Details

  • Last updated: Tue, 06 May 2025 0717 GMT
  • Dependencies: none

Credits

These definitions were written by Wooram Jun.