@types/file-saver

  • Version 2.0.3
  • Published
  • 7.47 kB
  • No dependencies
  • MIT license

Install

npm i @types/file-saver
yarn add @types/file-saver
pnpm add @types/file-saver

Overview

TypeScript definitions for FileSaver.js

Index

Functions

function saveAs

saveAs: {
(data: Blob | string, filename?: string, options?: FileSaverOptions): void;
(data: string | Blob, filename?: string, disableAutoBOM?: boolean): void;
};
  • FileSaver.js implements the saveAs() FileSaver interface in browsers that do not natively support it.

    Parameter data

    The actual file data blob or URL.

    Parameter 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.

    Parameter options

    Optional FileSaver.js config

  • FileSaver.js implements the saveAs() FileSaver interface in browsers that do not natively support it.

    Parameter data

    The actual file data blob or URL.

    Parameter 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.

    Parameter 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

Interfaces

interface FileSaverOptions

interface FileSaverOptions {}

    property autoBom

    autoBom: boolean;
    • Automatically provide Unicode text encoding hints false

    Namespaces

    namespace global

    namespace global {}

      variable saveAs

      const saveAs: {
      (
      data: string | Blob,
      filename?: string,
      options?: FileSaver.FileSaverOptions
      ): void;
      (data: string | Blob, filename?: string, disableAutoBOM?: boolean): void;
      };

        interface Window

        interface Window {}

          property saveAs

          saveAs: typeof FileSaver.saveAs;

            Package Files (1)

            Dependencies (0)

            No dependencies.

            Dev Dependencies (0)

            No dev dependencies.

            Peer Dependencies (0)

            No peer dependencies.

            Badge

            To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

            You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/file-saver.

            • Markdown
              [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@types/file-saver)
            • HTML
              <a href="https://www.jsdocs.io/package/@types/file-saver"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>