vanillajs-browser-helpers
Version:
Collection of convenience code snippets (helpers) that aims to make it a little easier to work with vanilla JS in the browser
11 lines (10 loc) • 441 B
TypeScript
export declare function fileSavingSupported(): boolean;
/**
* Creates a file with given content and triggers download.
* (if the browser doesn't support file downloads, this method does nothing)
*
* @param content - The content of the file
* @param name - The name to give the downloaded file
* @param type - The content type of the file
*/
export default function saveFile(content: Blob | string, name: string, type?: string): void;