import { FilterOptions } from "../../createFilter/index.mjs"; import { PaginationContext, PaginationOptions } from "../../createPagination/index.mjs"; import { MaybeRefOrGetter, Ref, ShallowRef } from "vue"; //#region src/composables/createDataTable/adapters/adapter.d.ts type SortDirection = 'asc' | 'desc' | 'none'; interface SortEntry { key: string; direction: SortDirection; } /** Inputs provided by createDataTable to the adapter */ interface DataTableAdapterContext { /** Source items */ items: MaybeRefOrGetter; /** Search query ref */ search: ShallowRef; /** Column ids eligible for filtering (reactive — tracks the columns registry) */ filterableKeys: MaybeRefOrGetter; /** Current sort state derived from sort controls */ sortBy: Readonly>; /** Locale for sorting (reactive, from useLocale or options) */ locale: Readonly>; /** Filter options (keys excluded, derived from columns) */ filterOptions: Omit; /** Pagination options (size excluded, derived from pipeline) */ paginationOptions: Omit; /** Per-column custom sort comparators (reactive — tracks the columns registry). Keys are column ids, which may be `keyof T` or derived strings. */ customSorts: MaybeRefOrGetter number>>>; /** Per-column custom filter functions (reactive — tracks the columns registry). Keys are column ids, which may be `keyof T` or derived strings. */ customColumnFilters: MaybeRefOrGetter boolean>>>; } /** Outputs returned by the adapter to createDataTable */ interface DataTableAdapterResult { /** Raw unprocessed items */ allItems: Readonly>; /** Items after filtering */ filteredItems: Readonly>; /** Items after filtering and sorting */ sortedItems: Readonly>; /** Final visible items (paginated or virtualized) */ items: Readonly>; /** Pagination controls */ pagination: PaginationContext; /** Total row count for aria-rowcount */ total: Readonly>; /** Loading state (optional, for async adapters) */ loading?: Readonly>; /** Error state (optional, for async adapters) */ error?: Readonly>; } declare abstract class DataTableAdapter { /** Create the filter pipeline stage */ protected filter(context: DataTableAdapterContext): { allItems: Readonly>; filteredItems: Readonly>; }; /** Create the sort pipeline stage */ protected sort(filteredItems: Readonly>, sortBy: Readonly>, locale?: Readonly>, customSorts?: MaybeRefOrGetter number>>>): Readonly>; abstract setup(context: DataTableAdapterContext): DataTableAdapterResult; } //#endregion export { DataTableAdapter, DataTableAdapterContext, DataTableAdapterResult, SortDirection, SortEntry };