# @types/file-saver

> TypeScript definitions for file-saver

Latest version **2.0.7** (published 2023-11-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/file-saver
pnpm add @types/file-saver
yarn add @types/file-saver
bun add @types/file-saver
```

## Health

**Score 45/100 (D)** — status: abandoned.

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

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 2.0.7 |
| Published | 2023-11-07 |
| First published | 2016-11-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51441 |
| Maintainers | types |

## Links

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

## Recent versions

- 2.0.7 (latest) — 2023-11-07
- 2.0.5 (ts3.8) — 2022-01-11
- 2.0.4 (ts3.7) — 2021-11-16
- 2.0.3 (ts3.6) — 2021-07-09
- 2.0.2 (ts3.5) — 2021-04-08
- 2.0.1 (ts2.0) — 2019-05-21
- 2.0.6 — 2023-10-18
- 2.0.0 — 2018-11-06
- 1.3.1 — 2018-10-08
- 1.3.0 — 2017-11-08
- 0.0.1 — 2017-04-26
- 0.0.0 — 2016-11-06

## README

# Installation
> `npm install --save @types/file-saver`

# Summary
This package contains type definitions for file-saver (https://github.com/eligrey/FileSaver.js/).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/file-saver.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/file-saver/index.d.ts)
````ts
export = FileSaver;

export as namespace saveAs;

/**
 * FileSaver.js implements the saveAs() FileSaver interface in browsers that do not natively support it.
 * @param data - The actual file data blob or URL.
 * @param filename - The optional name of the file to be downloaded. If omitted, the name used in the file data will be used. If none is provided "download" will be used.
 * @param options - Optional FileSaver.js config
 */
declare function FileSaver(data: Blob | string, filename?: string, options?: FileSaver.FileSaverOptions): void;

/**
 * FileSaver.js implements the saveAs() FileSaver interface in browsers that do not natively support it.
 * @param data - The actual file data blob or URL.
 * @param filename - The optional name of the file to be downloaded. If omitted, the name used in the file data will be used. If none is provided "download" will be used.
 * @param disableAutoBOM - Optional & defaults to `true`. Set to `false` if you want FileSaver.js to automatically provide Unicode text encoding hints
 * @deprecated use `{ autoBom: false }` as the third argument
 */
// tslint:disable-next-line:unified-signatures
declare function FileSaver(data: Blob | string, filename?: string, disableAutoBOM?: boolean): void;

declare namespace FileSaver {
    interface FileSaverOptions {
        /**
         * Automatically provide Unicode text encoding hints
         * @default false
         */
        autoBom: boolean;
    }

    const saveAs: typeof FileSaver;
}

````

### Additional Details
 * Last updated: Tue, 07 Nov 2023 03:09:37 GMT
 * Dependencies: none

# Credits
These definitions were written by [Cyril Schumacher](https://github.com/cyrilschumacher), [Daniel Roth](https://github.com/DaIgeb), [HitkoDev](https://github.com/HitkoDev), [JounQin](https://github.com/JounQin), and [BendingBender](https://github.com/bendingbender).

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