import { type Readable } from '@vielzeug/ripple'; export type SortDirection = 'asc' | 'desc' | 'none'; export type SortState = { direction: SortDirection; key: string; }; export type DataGridColumn> = { align?: 'left' | 'center' | 'right'; cell?: (item: T) => string; headerLabel?: string; key: string; label: string; renderExpanded?: (item: T) => string; resizable?: boolean; sortable?: boolean; sortValue?: (item: T) => number | string; width?: string; }; export type SelectionMode = 'multi' | 'none' | 'single'; export type FilterOption = { key: string; label: string; operators?: { label: string; value: string; }[]; options: { label?: string; value: string; }[]; }; export type FilterOperator = 'contains' | 'equals' | 'gt' | 'lt'; export type FilterRule = { operator: FilterOperator; values: Set; }; export type DataGridView = { id: string; label: string; }; export type DataGridModelOptions> = { clientSide: Readable; columns: Readable[]>; filterOptions: Readable; getRowKey: (item: T) => string; items: Readable; onSelectionChange?: (keys: Set) => void; onSortChange?: (sort: SortState) => void; pageSize: Readable; selectionMode: Readable; sortMode: Readable<'client' | 'server'>; }; export type DataGridModel> = { activateFilterKey(key: string): void; clearAllFilters(): void; clearSelection(): void; readonly currentPageItems: Readable; readonly filterDefs: Readable; readonly filteredRows: Readable; readonly filterValues: Readable>; goToPage(index: number): void; readonly hasNextPage: Readable; readonly hasPrevPage: Readable; readonly hiddenColumns: Readable>; isAllSelected(): boolean; nextPage(): void; readonly pageCount: Readable; readonly pageIndex: Readable; prevPage(): void; removeFilter(key: string): void; resetFilters(): void; resetSearch(): void; readonly searchActive: Readable; readonly searchQuery: Readable; selectAll(): void; readonly selectedKeys: Readable>; readonly selectedRows: Readable; setActiveFilterKeys(keys: string[]): void; setFilter(key: string, values: string[]): void; setFilterOperator(key: string, operator: FilterOperator): void; setSearchQuery(query: string): void; setSelection(keys: Set): void; sortBy(key: string): void; readonly sortState: Readable; sortTo(key: string, direction: SortDirection): void; toggleColumnVisibility(key: string): void; toggleRow(key: string): void; toggleSearch(): void; readonly totalItems: Readable; readonly visibleColumns: Readable[]>; }; /** * Feature-owned state and transform pipeline for `ore-datagrid`. * * Rows flow through query, filters, sorting, and pagination in order. Selection * and column visibility share the same model so every interactive grid concern * has one reactive owner. Source-backed grids retain their server-owned rows by * setting `clientSide` to false. */ export declare const createDataGridModel: >(options: DataGridModelOptions) => DataGridModel; //# sourceMappingURL=datagrid-model.d.ts.map