Skip to main content

FileSaverControls

How the file saver contract scripts a port. A real adapter implements these by providing or hiding the browser's file and download support.

This is an interface exported by @mapcairn/core/contracts, checked against version 0.2.0.

Signature​

import type { FileSaverControls } from "@mapcairn/core/contracts";

interface FileSaverControls

Methods​

saved​

saved(): readonly SavedFile[];

The files that were saved, oldest first.

willFail​

willFail(reason: FileSaverContractFailure): void;

Makes every later save fail the way reason describes.

  • reason (FileSaverContractFailure)

willSucceed​

willSucceed(): void;

Makes every later save succeed.

See also​

Source: packages/core/src/contracts/fileSaver.contract.ts:16