import { GridApi } from 'ag-grid-enterprise'; import { PTableHandle, PTableColumnSpec, PFrameSpecDriver, PlDataTableColumnsMeta, WritePTableToFsResult } from '@platforma-sdk/model'; import { Nil } from '@milaboratories/helpers'; /** Options for the native table export. */ export interface ExportOptions { tableHandle: PTableHandle; defaultFileName?: string; /** * Sidecar display metadata for the visible table. Supplies the disambiguated * header labels the UI shows — the ones the spec's intrinsic `pl7.app/label` * may not carry — so the export reproduces exactly what the user sees. */ columnsMeta?: PlDataTableColumnsMeta; } /** * Table export via the platforma desktop runtime. Prompts for a save * destination via the `Dialog` service — offering the available output formats * as file-type filters so the user picks the format — then writes the PTable to * the chosen path. * * Prefers the native `PFrame.exportPTable` when the runtime advertises it: the * table handle is the *visible* one, so exporting the whole handle reproduces * exactly the visible columns/rows, and the format (`csv`/`tsv`/`parquet`/ * `xlsx`) is taken from the chosen file extension. Falls back to streaming the * visible columns via `PFrame.writePTableToFs` (`csv`/`tsv`, optionally * gzip-compressed when the chosen path ends in `.gz`) on runtimes that do not * advertise `exportPTable`. */ export declare function exportCsv(gridApi: GridApi, nativeOptions: ExportOptions): Promise; /** * Checks whether the native CSV export capability is available in the * current platforma runtime environment. Both `Dialog` and `PFrame` * services must be present — desktop-app wires them, web/preview do not. */ export declare function isCsvExportAvailable(): boolean; /** * Collect `[unified index, header name]` pairs for visible (non-hidden) columns * from the ag-grid column defs, remapped onto the provided PTable spec array so * the indices match the current table handle (ColDef.field indices may be stale * or diverge from the spec order). * * The header name is the disambiguated label the UI shows — sidecar override * (`columnsMeta`) wins over the spec's intrinsic `pl7.app/label`, falling back * to the spec name — so the export reproduces exactly the visible headers and * avoids the duplicate-label collisions that break the native export path. */ export declare function collectVisibleColumns(gridApi: GridApi, specs: PTableColumnSpec[], pframeSpec: PFrameSpecDriver, columnsMeta: PlDataTableColumnsMeta | undefined): Nil | [number, string][]; //# sourceMappingURL=export-csv.d.ts.map