UNPKG

@humanspeak/svelte-headless-table

Version:

A powerful, headless table library for Svelte that provides complete control over table UI while handling complex data operations like sorting, filtering, pagination, grouping, and row expansion. Build custom, accessible data tables with zero styling opin

22 lines (21 loc) 830 B
import { type Readable } from 'svelte/store'; import type { TablePlugin } from '../types/TablePlugin.js'; export type DataExportFormat = 'object' | 'json' | 'csv'; type ExportForFormat = { object: Record<string, unknown>[]; json: string; csv: string; }; export type DataExport<F extends DataExportFormat> = ExportForFormat[F]; export interface DataExportConfig<F extends DataExportFormat> { childrenKey?: string; format?: F; } export interface DataExportState<F extends DataExportFormat> { exportedData: Readable<DataExport<F>>; } export interface DataExportColumnOptions { exclude?: boolean; } export declare const addDataExport: <Item, F extends DataExportFormat = "object">({ format, childrenKey }?: DataExportConfig<F>) => TablePlugin<Item, DataExportState<F>, DataExportColumnOptions>; export {};