@types/content-disposition
TypeScript definitions for content-disposition
Last updated 3 years ago by types .
MIT · Repository · Original npm · Tarball · package.json
$ gnpm install @types/content-disposition 
SYNC missed versions from official npm registry.

Installation

npm install --save @types/content-disposition

Summary

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

Details

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

index.d.ts

// Type definitions for content-disposition 0.5
// Project: https://github.com/jshttp/content-disposition
// Definitions by: Stefan Reichel <https://github.com/bomret>
//                 Piotr Błażejewicz <https://github.com/peterblazejewicz>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

declare namespace contentDisposition {
    /**
     * Class for parsed Content-Disposition header for v8 optimization
     */
    interface ContentDisposition {
        /**
         * The disposition type (always lower case)
         */
        type: "attachment" | "inline" | string;
        /**
         * An object of the parameters in the disposition
         * (name of parameter always lower case and extended versions replace non-extended versions)
         */
        parameters: { [key: string]: string };
    }

    interface Options {
        /**
         * Specifies the disposition type.
         * This can also be "inline", or any other value (all values except `inline` are treated like attachment,
         * but can convey additional information if both parties agree to it).
         * The `type` is normalized to lower-case.
         * @default 'attachment'
         */
        type?: "attachment" | "inline" | string | undefined;
        /**
         * If the filename option is outside ISO-8859-1,
         * then the file name is actually stored in a supplemental field for clients
         * that support Unicode file names and a ISO-8859-1 version of the file name is automatically generated
         * @default true
         */
        fallback?: string | boolean | undefined;
    }

    /**
     * Parse a Content-Disposition header string
     */
    function parse(contentDispositionHeader: string): ContentDisposition;
}

/**
 * Create an attachment `Content-Disposition` header value using the given file name, if supplied.
 * The `filename` is optional and if no file name is desired, but you want to specify options, set `filename` to undefined.
 */
declare function contentDisposition(filename?: string, options?: contentDisposition.Options): string;

export = contentDisposition;

Additional Details

  • Last updated: Mon, 04 Sep 2023 15:41:09 GMT
  • Dependencies: none
  • Global values: none

Credits

These definitions were written by Stefan Reichel, and Piotr Błażejewicz.

Current Tags

  • 0.5.6                                ...           latest (a year ago)
  • 0.5.2                                ...           ts2.0 (8 years ago)
  • 0.5.2                                ...           ts2.1 (8 years ago)
  • 0.5.2                                ...           ts2.2 (8 years ago)
  • 0.5.2                                ...           ts2.3 (8 years ago)
  • 0.5.2                                ...           ts2.4 (8 years ago)
  • 0.5.2                                ...           ts2.5 (8 years ago)
  • 0.5.2                                ...           ts2.6 (8 years ago)
  • 0.5.2                                ...           ts2.7 (8 years ago)
  • 0.5.3                                ...           ts2.8 (5 years ago)
  • 0.5.3                                ...           ts2.9 (5 years ago)
  • 0.5.3                                ...           ts3.0 (5 years ago)
  • 0.5.3                                ...           ts3.1 (5 years ago)
  • 0.5.3                                ...           ts3.2 (5 years ago)
  • 0.5.3                                ...           ts3.3 (5 years ago)
  • 0.5.3                                ...           ts3.4 (5 years ago)
  • 0.5.3                                ...           ts3.5 (5 years ago)
  • 0.5.4                                ...           ts3.6 (4 years ago)
  • 0.5.4                                ...           ts3.7 (4 years ago)
  • 0.5.4                                ...           ts3.8 (4 years ago)
  • 0.5.5                                ...           ts3.9 (3 years ago)
  • 0.5.5                                ...           ts4.0 (3 years ago)
  • 0.5.5                                ...           ts4.1 (3 years ago)
  • 0.5.5                                ...           ts4.2 (3 years ago)
  • 0.5.6                                ...           ts4.3 (a year ago)
  • 0.5.6                                ...           ts4.4 (a year ago)
  • 0.5.6                                ...           ts4.5 (a year ago)
  • 0.5.6                                ...           ts4.6 (a year ago)
  • 0.5.6                                ...           ts4.7 (a year ago)
  • 0.5.6                                ...           ts4.8 (a year ago)
  • 0.5.6                                ...           ts4.9 (a year ago)
  • 0.5.6                                ...           ts5.0 (a year ago)
  • 0.5.6                                ...           ts5.1 (a year ago)
  • 0.5.6                                ...           ts5.2 (a year ago)
  • 0.5.6                                ...           ts5.3 (a year ago)

7 Versions

  • 0.5.6                                ...           a year ago
  • 0.5.5                                ...           3 years ago
  • 0.5.4                                ...           4 years ago
  • 0.5.3                                ...           5 years ago
  • 0.5.2                                ...           8 years ago
  • 0.5.1                                ...           8 years ago
  • 0.5.0                                ...           8 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 7
Last Day 0
Last Week 7
Last Month 0
Dependencies (0)
None
Dev Dependencies (0)
None
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |