@types/content-type
    TypeScript icon, indicating that this package has built-in type declarations

    1.1.5 • Public • Published

    Installation

    npm install --save @types/content-type

    Summary

    This package contains type definitions for content-type (https://github.com/jshttp/content-type).

    Details

    Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/content-type.

    index.d.ts

    // Type definitions for content-type 1.1
    // Project: https://github.com/jshttp/content-type
    // Definitions by: Hiroki Horiuchi <https://github.com/horiuchi>
    //                 BendingBender <https://github.com/BendingBender>
    // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
    
    export function parse(input: RequestLike | ResponseLike | string): ParsedMediaType;
    export function format(obj: MediaType): string;
    
    export interface ParsedMediaType {
        type: string;
        parameters: {[key: string]: string};
    }
    
    export interface MediaType {
        type: string;
        parameters?: {[key: string]: string} | undefined;
    }
    
    export interface RequestLike {
        headers: {[header: string]: string | string[] | undefined};
    }
    
    export interface ResponseLike {
        getHeader(name: string): number | string | string[] | undefined;
    }

    Additional Details

    • Last updated: Fri, 09 Jul 2021 02:32:23 GMT
    • Dependencies: none
    • Global values: none

    Credits

    These definitions were written by Hiroki Horiuchi, and BendingBender.

    Keywords

    none

    Install

    npm i @types/content-type

    DownloadsWeekly Downloads

    300,004

    Version

    1.1.5

    License

    MIT

    Unpacked Size

    4.46 kB

    Total Files

    4

    Last publish

    Collaborators

    • avatar