@types/negotiator

  • Version 0.6.1
  • Published
  • No dependencies
  • MIT license

Install

npm i @types/negotiator
yarn add @types/negotiator
pnpm add @types/negotiator

Overview

TypeScript definitions for negotiator

Index

Classes

class Negotiator

class Negotiator {}

    constructor

    constructor(req: { headers: Negotiator.Headers });
    • The negotiator constructor receives a request object

    method charset

    charset: (availableCharsets?: string[]) => string | undefined;
    • Returns the most preferred charset from the client.

      Parameter availableCharsets

      When provided, returns the most preferred charset from a list of available charsets.

    method charsets

    charsets: (availableCharsets?: string[]) => string[];
    • Returns an array of preferred charsets ordered by the client preference.

      Parameter availableCharsets

      When provided, returns an array of preferred charsets ordered by priority from a list of available charsets.

    method encoding

    encoding: (availableEncodings?: string[]) => string | undefined;
    • Returns the most preferred encoding from the client.

      Parameter availableEncodings

      When provided, returns the most preferred encoding from a list of available encodings.

    method encodings

    encodings: (availableEncodings?: string[]) => string[];
    • Returns an array of preferred encodings ordered by the client preference.

      Parameter availableEncodings

      When provided, returns an array of preferred encodings ordered by priority from a list of available encodings.

    method language

    language: (availableLanguages?: string[]) => string | undefined;
    • Returns the most preferred language from the client.

      Parameter availableLanguages

      When provided, returns the most preferred language from a list of available languages.

    method languages

    languages: (availableLanguages?: string[]) => string[];
    • Returns an array of preferred languages ordered by the client preference.

      Parameter availableLanguages

      When provided, returns an array of preferred languages ordered by priority from a list of available languages.

    method mediaType

    mediaType: (availableMediaTypes?: string[]) => string | undefined;
    • Returns the most preferred media type from the client.

      Parameter availableMediaTypes

      When provided, returns the most preferred media type from a list of available media types.

    method mediaTypes

    mediaTypes: (availableMediaTypes?: string[]) => string[];
    • Returns an array of preferred media types ordered by the client preference

      Parameter availableMediaTypes

      When provided, returns an array of preferred media types ordered by priority from a list of available media types.

    Interfaces

    interface Headers

    interface Headers {}

      index signature

      [key: string]: string | string[] | undefined;

        Package Files (1)

        Dependencies (0)

        No dependencies.

        Dev Dependencies (0)

        No dev dependencies.

        Peer Dependencies (0)

        No peer dependencies.

        Badge

        To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

        You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/negotiator.

        • Markdown
          [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@types/negotiator)
        • HTML
          <a href="https://www.jsdocs.io/package/@types/negotiator"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>