import type { Snippet } from "svelte"; import type { CellDecoration } from "./cellDecoration.js"; export type { CellDecoration, CellDecorationIntent } from "./cellDecoration.js"; export interface DataTableColumn { key: string; label: string; sortable?: boolean; align?: "start" | "center" | "end"; width?: string; cell?: Snippet<[R, DataTableColumn]>; /** * Conditional formatting (confort) : décoration sémantique calculée par * cellule. Si une `decorations` map est aussi fournie, la map gagne. */ cellDecoration?: (row: R, value: unknown, colId: string) => CellDecoration | null; } export interface DataTableRow { id: string; [key: string]: unknown; } export type DataTableSelectMode = "none" | "single" | "multiple"; export interface DataTableSort { key: string; direction: "asc" | "desc"; } import type { HTMLTableAttributes } from "svelte/elements"; type DataTableProps = Omit & { columns: DataTableColumn[]; rows: DataTableRow[]; /** * Conditional formatting : décorations sémantiques par cellule, indexées * `rowId` → `colId` → décoration. Prioritaire sur `column.cellDecoration`. */ decorations?: Record>; caption?: string; size?: "sm" | "md" | "lg"; selectable?: DataTableSelectMode; selectedIds?: string[]; sortable?: boolean; sortBy?: DataTableSort | null; pageSize?: number; page?: number; locale?: string; selectAllLabel?: string; selectRowLabel?: string; sortAscendingLabel?: string; sortDescendingLabel?: string; sortNoneLabel?: string; previousLabel?: string; nextLabel?: string; paginationLabel?: string; rangeLabel?: (range: { start: number; end: number; total: number; }) => string; emptyLabel?: string; onRowClick?: (row: DataTableRow) => void; class?: string; }; declare const DataTable: import("svelte").Component; type DataTable = ReturnType; export default DataTable; //# sourceMappingURL=DataTable.svelte.d.ts.map