/** * DataTable props extensions for the download feature. * @public * @deprecated Will be removed. Please use the `onDownloadData` callback on the `DataTable.DownloadData` slot instead. */ export interface DataTableDownloadProps { /** * Called when table data was downloaded (programmatically or via the toolbar). * @param subset - indicates which data was downloaded (all data, current page or selected rows). * @param excludedColumns - array of column IDs that were excluded from the download. * @deprecated Will be removed. Please use the `onDownloadData` callback on the `DataTable.DownloadData` slot instead. */ onDownloadData?: (subset: 'all' | 'page' | 'selected', excludedColumns?: string[]) => void; } /** * Context passed to the `formatDownloadHeader` callback for a single leaf column * that is included in the download. * @public */ export interface DataTableDownloadHeaderContext { /** * The leaf column's ID. Stable identity that also works for custom-rendered headers. */ columnId: string; /** * The leaf column's header string, e.g. `"First Name"`. Falls back to the column ID * when the column's `header` is a function or undefined. */ leafHeader: string; /** * The parent group column's header string, e.g. `"Person"`, * or `undefined` if the column has no parent group. Falls back to the parent column ID * when the column's `header` is a function or undefined */ groupHeader?: string; } /** * DataTable slot definition for the Download action. * @public */ export interface DataTableDownloadSlotProps { /** * Array of column IDs that can optionally be excluded from the download. */ excludeColumns?: string[]; /** * Called when table data was downloaded via the toolbar, or programmatically when the slot is configured. * @param subset - indicates which data was downloaded (all data, current page or selected rows). * @param excludedColumns - array of column IDs that were excluded from the download. */ onDownloadData?: (subset: 'all' | 'page' | 'selected', excludedColumns?: string[]) => void; /** * Called once per included leaf column to determine its header name in the downloaded file. * Return the string to use as the header name, or `undefined` to keep the default name. * Only invoked for columns that appear in the download (visible, not excluded, not builtin/sparkline). */ formatDownloadHeader?: (context: DataTableDownloadHeaderContext) => string | undefined; /** * Name of the downloaded CSV file. Pass a static string or a callback that * receives the downloaded subset (`'all'`, `'page'`, or `'selected'`) and * returns the file name. The callback is invoked lazily, once per download. * Falls back to `table-data.csv` when omitted, empty, or when nothing usable * remains after sanitization. A missing `.csv` extension is appended * automatically. * * @remarks * Under a strict Content-Security-Policy, Firefox may ignore the custom name * and use `table-data.csv` instead; the download still succeeds. Other * evergreen browsers honor the custom name. */ fileName?: string | ((subset: 'all' | 'page' | 'selected') => string); } /** * Extension interface for the TanStack table instance. * @internal */ export interface DataTableDownloadDataInstance { /** * Allows to download the entire table as a csv file. * Will only include the visible columns, and columns that are not excluded via `excludeColumns`. * @param excludeColumns - defines which visible columns should be excluded from the download. * @param formatDownloadHeader - optional per-column header override; takes precedence over `table.options.formatDownloadHeader`. * @param fileName - name of the downloaded CSV file. * @param onDownloadEnd - internal callback fired when the download finishes, independent of success or failure. */ downloadAllData: (excludeColumns?: string[], formatDownloadHeader?: (context: DataTableDownloadHeaderContext) => string | undefined, fileName?: string | ((subset: 'all' | 'page' | 'selected') => string), onDownloadEnd?: () => void) => void; /** * Allows to download the current page as a csv file. * Will only include the visible columns, and columns that are not excluded via `excludeColumns`. * @param excludeColumns - defines which visible columns should be excluded from the download. * @param formatDownloadHeader - optional per-column header override; takes precedence over `table.options.formatDownloadHeader`. * @param fileName - name of the downloaded CSV file. * @param onDownloadEnd - internal callback fired when the download finishes, independent of success or failure. */ downloadPageData: (excludeColumns?: string[], formatDownloadHeader?: (context: DataTableDownloadHeaderContext) => string | undefined, fileName?: string | ((subset: 'all' | 'page' | 'selected') => string), onDownloadEnd?: () => void) => void; /** * Allows to download the current selected rows as a csv file. * Will only include the visible columns, and columns that are not excluded via `excludeColumns`. * @param excludeColumns - defines which visible columns should be excluded from the download. * @param formatDownloadHeader - optional per-column header override; takes precedence over `table.options.formatDownloadHeader`. * @param fileName - name of the downloaded CSV file. * @param onDownloadEnd - internal callback fired when the download finishes, independent of success or failure. */ downloadSelectedData: (excludeColumns?: string[], formatDownloadHeader?: (context: DataTableDownloadHeaderContext) => string | undefined, fileName?: string | ((subset: 'all' | 'page' | 'selected') => string), onDownloadEnd?: () => void) => void; } /** * Extension interface for the TanStack table instance. * @internal */ export interface DataTableDownloadDataHeader { getDownloadString: () => string; } /** * Extension interface for the TanStack table instance. * @internal */ export interface DataTableDownloadDataCell { getDownloadString: () => string; } export interface DataTableDownloadDataOptions { onDownloadData?: (subset: 'all' | 'page' | 'selected', excludedColumns?: string[]) => void; formatDownloadHeader?: (context: DataTableDownloadHeaderContext) => string | undefined; } /** * Interface defining the constructors for the download data feature, * including the API implementations and prototype assignments. */ export interface DownloadDataFeatureConstructors { Table: DataTableDownloadDataInstance; Header: DataTableDownloadDataHeader; Cell: DataTableDownloadDataCell; TableOptions: DataTableDownloadDataOptions; } //# sourceMappingURL=download-types.d.ts.map