rollun-ts-utils
Version:
Simple JavaScript utils
17 lines (16 loc) • 649 B
TypeScript
import { CSVData } from './arrayToCSV';
/**
* Download data as JSON
*/
export declare const downloadAsJSON: (data: any, filename?: string) => void;
/**
* Download data as CSV
*/
export declare const downloadAsCSV: (data: CSVData, filename?: string) => void;
export declare const downloadAsText: (data: any, filename?: string) => void;
/**
* Downloads prided {data} with {type}, to {filename} file
*/
declare type ContentTypes = 'application/json' | 'text/csv' | 'text/plain' | 'application/pdf' | string;
export declare const downloadDataWithContentType: (data: string | BufferSource, type: ContentTypes, filename: string) => void;
export {};