New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@types/streamsaver

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/streamsaver

TypeScript definitions for streamsaver

  • 2.0.5
  • ts4.8
  • ts4.9
  • ts5.0
  • ts5.1
  • ts5.2
  • ts5.3
  • ts5.4
  • ts5.5
  • ts5.6
  • ts5.7
  • ts5.8
  • ts5.9
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
21K
increased by6.62%
Maintainers
1
Weekly downloads
 
Created
Source

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

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.

FAQs

Package last updated on 14 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc