UNPKG

rightui

Version:

Beautiful UI library for Svelte. Based on shadcn-svelte. For Wonrity

41 lines (40 loc) 1.4 kB
import { type RowData, type TableOptions } from "@tanstack/table-core"; /** * Creates a reactive TanStack table object for Svelte. * @param options Table options to create the table with. * @returns A reactive table object. * @example * ```svelte * <script> * const table = createSvelteTable({ ... }) * </script> * * <table> * <thead> * {#each table.getHeaderGroups() as headerGroup} * <tr> * {#each headerGroup.headers as header} * <th colspan={header.colSpan}> * <FlexRender content={header.column.columnDef.header} context={header.getContext()} /> * </th> * {/each} * </tr> * {/each} * </thead> * <!-- ... --> * </table> * ``` */ export declare function createSvelteTable<TData extends RowData>(options: TableOptions<TData>): import("@tanstack/table-core").Table<TData>; type MaybeThunk<T extends object> = T | (() => T | null | undefined); type Intersection<T extends readonly unknown[]> = (T extends [infer H, ...infer R] ? H & Intersection<R> : unknown) & {}; /** * Lazily merges several objects (or thunks) while preserving * getter semantics from every source. * * Proxy-based to avoid known WebKit recursion issue. */ export declare function mergeObjects<Sources extends readonly MaybeThunk<any>[]>(...sources: Sources): Intersection<{ [K in keyof Sources]: Sources[K]; }>; export {};