@geogirafe/lib-geoportal
Version:
GeoGirafe is a flexible application to build online geoportals.
42 lines (41 loc) • 1.17 kB
TypeScript
import GirafeSingleton from '../../base/GirafeSingleton';
import GirafeConfig from '../configuration/girafeconfig';
/**
* Definition for grid columns.
*/
type GridColumnDef = {
/**
* Name of a column.
*/
name: string;
};
export default class CsvManager extends GirafeSingleton {
private configManager;
private i18nManager;
constructor(type: string);
get config(): GirafeConfig;
/**
* Generate a CSV.
* @param data Entries/objects to include in the CSV.
* @param columnDefs Column definitions.
* @returns The CSV file as string.
*/
generateCsv(data: {
[x: string]: unknown;
}[], columnDefs: GridColumnDef[]): string;
/**
* @param values Values.
* @returns CSV row.
*/
private getRow;
/**
* Generate a CSV and start a download with the generated file.
* @param data Entries/objects to include in the CSV.
* @param columnDefs Column definitions.
* @param fileName The CSV file name, without the extension.
*/
startDownload(data: {
[x: string]: unknown;
}[], columnDefs: GridColumnDef[], fileName: string): void;
}
export {};