# @types/content-disposition

> TypeScript definitions for content-disposition

Latest version **0.5.9** (published 2025-06-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/content-disposition
pnpm add @types/content-disposition
yarn add @types/content-disposition
bun add @types/content-disposition
```

## Health

**Score 55/100 (C)** — status: stable.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support; pre 1.0.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 0.5.9 |
| Published | 2025-06-07 |
| First published | 2016-12-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51431 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/content-disposition
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/content-disposition
- npm.io page: https://npm.io/package/@types/content-disposition

## Recent versions

- 0.5.9 (latest) — 2025-06-07
- 0.5.8 (ts5.0) — 2023-11-07
- 0.5.6 (ts4.3) — 2023-09-04
- 0.5.5 (ts4.1) — 2022-05-05
- 0.5.4 (ts3.7) — 2021-07-06
- 0.5.3 (ts3.5) — 2020-03-31
- 0.5.2 (ts2.6) — 2017-03-24
- 0.5.7 — 2023-10-18
- 0.5.1 — 2017-01-13
- 0.5.0 — 2016-12-08

## README

# 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](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/content-disposition/index.d.ts)
````ts
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: Sat, 07 Jun 2025 02:15:25 GMT
 * Dependencies: none

# Credits
These definitions were written by [Stefan Reichel](https://github.com/bomret), [Piotr Błażejewicz](https://github.com/peterblazejewicz), and [Sebastian Beltran](https://github.com/bjohansebas).

---
_Source: https://npm.io/package/@types/content-disposition · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
