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

10 lines (9 loc) 538 B
import type { NewTablePropSet, TablePlugin } from '../types/TablePlugin.js'; export type ValidChildrenKey<Item> = { [Key in keyof Item]: Item[Key] extends Item[] ? Key : never; }[keyof Item]; export type ValidChildrenFn<Item> = (item: Item) => Item[] | undefined; export interface SubRowsConfig<Item> { children: ValidChildrenKey<Item> | ValidChildrenFn<Item>; } export declare const addSubRows: <Item>({ children }: SubRowsConfig<Item>) => TablePlugin<Item, Record<string, never>, Record<string, never>, NewTablePropSet<never>>;