@byetool/json-exporter
Version:
A library that supports exporting json to .xls, .xlsx, .csv, .html, .xml, .json, .txt files in browser
33 lines (32 loc) • 1.15 kB
TypeScript
export interface Obj {
[key: string]: any;
}
export type Header = string | {
name: string;
alias: string;
};
export interface Options {
headers?: Header[];
skipHeader?: boolean;
dateNF?: string;
cellDates?: boolean;
sheetStubs?: boolean;
nullError?: boolean;
}
export declare function toXLS(data: Obj[], filename: string, options?: Options): void;
export declare function toXLSX(data: Obj[], filename: string, options?: Options): void;
export declare function toCSV(data: Obj[], filename: string, options?: Options): void;
export declare function toHTML(data: Obj[], filename: string, options?: Options): void;
export declare function toXML(data: Obj[], filename: string, options?: Options): void;
export declare function toJSON(data: Obj[], filename: string, options?: Options): void;
export declare function toText(data: Obj[], filename: string, options?: Options): void;
declare const Exporter: {
toXLS: typeof toXLS;
toXLSX: typeof toXLSX;
toCSV: typeof toCSV;
toHTML: typeof toHTML;
toXML: typeof toXML;
toJSON: typeof toJSON;
toText: typeof toText;
};
export default Exporter;