import { DataSourceAdapter } from "../models/dataSourceAdapter.model"; import { Readable } from "stream"; import { Response } from 'express'; type DownloadParameters = Parameters; interface ExportOperation { parameters: DownloadParameters; dataSourceName: string; format: keyof typeof ExportFormat; } export declare enum ExportFormat { json = "json", csv = "csv", xlsx = "xlsx" } /** * Service for exporting files into various formats */ export declare class Exporter { private readonly operations; createOperation({ parameters, dataSourceName, format }: ExportOperation): string; getOperation(id: string): ExportOperation | undefined; getHeadersByFormat(format: keyof typeof ExportFormat, filename: string): { [key: string]: string; }; /** * Flattens a nested object/array structure into a single-level object * @example { name: "John", address: { city: "NY" } } => { name: "John", address__city: "NY" } */ private flattenObject; /** * Formats a Date object into a string "YYYY-MM-DD HH:mm:ss" * @example new Date("2023-08-15T14:30:00Z") => "2023-08-15 14:30:00" */ private formatDate; private sortHeaders; convertToJSON(stream: Readable, res: Response): void; convertToCSV(stream: Readable, res: Response): void; private escapeValueForCSV; convertToXLSX(stream: Readable, res: Response): Promise; } export {};