import { HoistService, TrackOptions } from '@xh/hoist/core'; import { GridModel, Column } from '@xh/hoist/cmp/grid'; import { StoreRecord } from '@xh/hoist/data'; /** * Exports Grid data to either Excel or CSV via Hoist's server-side export capabilities. * See the Column API for options to control exported values and formats. */ export declare class GridExportService extends HoistService { telemetryPrefix: string; xhImpl: boolean; static instance: GridExportService; /** * Export the data within a GridModel to a file. Typically called via `GridModel.exportAsync()`. */ exportAsync(gridModel: GridModel, opts?: ExportOptions): Promise; private doExportAsync; /** * Get the exportable value for a given cell. * Used internally by this service + public to support Grid's "copy cell" context menu action. */ getExportableValueForCell({ gridModel, record, column, node, forExcel }: { gridModel: GridModel; record: StoreRecord; column: Column; node?: any; forExcel?: boolean; }): any; private showFailToast; private getExportableColumns; private getExportFieldType; private getColumnMetadata; private getHeaderRow; private getRecordRowsRecursive; private getRecordRow; private getFileExtension; private minWait; private getCellSpecificType; } export interface ExportOptions { /** * Name for export file, or closure to generate. * Do not include the file extension - that will be appended based on the specified type. */ filename?: string | ((g: GridModel) => string); /** Type of export. */ type?: 'excel' | 'excelTable' | 'csv'; /** * Columns to include in export. Supports tokens 'VISIBLE' (default - all currently visible cols), * 'ALL', or specific column IDs to include (can be used in conjunction with VISIBLE to export * all visible and enumerated columns). Also supports a function returning column IDs to include. */ columns?: 'VISIBLE' | 'ALL' | string[] | ((g: GridModel) => string[]); /** True to enable activity tracking of exports (default false). */ track?: boolean | Partial; /** Timeout (in ms) for export request - defaults to 30 seconds. */ timeout?: number; }