# @types/streamsaver

> TypeScript definitions for streamsaver

Latest version **2.0.5** (published 2024-09-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/streamsaver
pnpm add @types/streamsaver
yarn add @types/streamsaver
bun add @types/streamsaver
```

## 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.5 |
| Published | 2024-09-14 |
| First published | 2020-06-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51442 |
| Maintainers | types |

## Links

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

## Recent versions

- 2.0.5 (latest) — 2024-09-14
- 2.0.4 (ts4.7) — 2023-11-07
- 2.0.1 (ts4.4) — 2021-07-02
- 2.0.0 (ts3.2) — 2020-06-05
- 2.0.3 — 2023-10-18
- 2.0.2 — 2023-09-25

## README

# Installation
> `npm install --save @types/streamsaver`

# Summary
This package contains type definitions for streamsaver (https://github.com/jimmywarting/StreamSaver.js).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/streamsaver.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/streamsaver/index.d.ts)
````ts
export as namespace streamSaver;

/**
 * Create a WritableStream. The data written to this stream will be streamed to the user's browser as a file download.
 * @param filename File name for the download.
 * @param options Additional options.
 */
export function createWriteStream(
    filename: string,
    options?: CreateWriteStreamOptions,
): WritableStream<Uint8Array>;

export interface CreateWriteStreamOptions<I = any, O = any> {
    /**
     * Indicates the size of the streamed data and allows the browser to show progress while downloading.
     */
    size?: number | undefined;
    /**
     * URL to serve the stream from. This is the URL that the browser is going to request from the service worker.
     * You might need to provide this if you're using a custom service worker.
     */
    pathname?: string | undefined;
    writableStrategy?: QueuingStrategy<I> | undefined;
    readableStrategy?: QueuingStrategy<O> | undefined;
}

export interface Version {
    full: string;
    major: number;
    minor: number;
    dot: number;
}

/**
 * StreamSaver.js library version.
 */
export const version: Version;

export let supported: boolean;

/**
 * URL to the man-in-the-middle page. By default, this is
 * https://jimmywarting.github.io/StreamSaver.js/mitm.html?version=2.0.0, but you can also serve this
 * file from your own server, or even provide a custom MITM file with a custom service worker.
 */
export let mitm: string;

/**
 * The WritableStream class that will be used by StreamSaver.js. By default, this is window.WritableStream,
 * but you can also provide a ponyfill or a polyfill if your target browser does not support it natively.
 */
export let WritableStream: {
    prototype: WritableStream;
    new<W = any>(underlyingSink?: UnderlyingSink<W>, strategy?: QueuingStrategy<W>): WritableStream<W>;
};

/**
 * The TransformStream class that will be used by StreamSaver.js. By default, this is the native TransformStream,
 * but you can also provide a ponyfill or a polyfill if your target browser does not support it natively.
 */
export let TransformStream: {
    prototype: TransformStream;
    new<I = any, O = any>(
        transformer: Transformer<I, O>,
        writableStrategy: QueuingStrategy<I>,
        readableStrategy: QueuingStrategy<O>,
    ): TransformStream<I, O>;
};

````

### Additional Details
 * Last updated: Sat, 14 Sep 2024 09:08:00 GMT
 * Dependencies: none

# Credits
These definitions were written by [Enn Michael](https://github.com/ennmichael).

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