import * as react_jsx_runtime from 'react/jsx-runtime'; import { W as WithDataSourceProps } from './withDataSource-tvEZcrJM.js'; import { IndexFiltersProps, useIndexResourceState } from '@shopify/polaris'; declare const ListTable: (props: WithDataSourceProps) => react_jsx_runtime.JSX.Element; type SortDefinition = { field: string; direction: 'asc' | 'desc'; }; type ViewDefinition = { _id?: string; name: string; filters: { queryValue?: string; [key: string]: any; }; }; type QueryResult = { items: T[]; total: number; page?: number; }; type QueryState = { page: number; limit: number; sort: string[] | undefined; filterValues: { queryValue?: string; [key: string]: string | any[] | undefined; }; viewSelected: string | null; }; interface UseDataSourceOptions { endpoint: string; queryKey: string; defaultSort?: SortDefinition; defaultLimit?: number; defaultViews?: ViewDefinition[]; syncWithUrl?: boolean; localData?: T[]; abbreviated?: boolean; transformResponse?: (response: unknown) => QueryResult; fetchFn?: (url: string, options?: RequestInit) => Promise; debounceMs?: number; } interface UseDataSourceReturn { state: QueryState; items: T[]; total: number; loading: boolean; firstLoad: boolean; error: Error | null; setPage: (page: number) => void; setQueryValue: (value: string) => void; setFilter: (key: string, value: any) => void; setFilters: (filters: Record) => void; clearFilters: () => void; setSort: (sort: SortDefinition | null) => void; setViewSelected: (view: ViewDefinition | null) => void; refresh: () => void; tabs: IndexFiltersProps['tabs']; sortOptions: IndexFiltersProps['sortOptions']; sortSelected: string[]; onSort: (selected: string[]) => void; pagination: { page: number; totalPages: number; hasPrevious: boolean; hasNext: boolean; onPrevious: () => void; onNext: () => void; goToPage: (page: number) => void; label: string; }; } /** * Hook for managing data source with filtering, sorting, and pagination */ declare function useDataSource({ endpoint, queryKey, defaultSort, defaultLimit, defaultViews, syncWithUrl, localData, abbreviated, transformResponse, fetchFn, debounceMs, }: UseDataSourceOptions): UseDataSourceReturn; type SelectionChangeHandler = ReturnType['handleSelectionChange']; interface UseSelectionReturn { selectedResources: string[]; allResourcesSelected: boolean; handleSelectionChange: SelectionChangeHandler; clearSelection: () => void; } /** * Hook for managing row selection in IndexTable */ declare function useSelection(items: T[]): UseSelectionReturn; interface UsePaginationOptions { page: number; limit: number; total: number; onPageChange: (page: number) => void; } interface UsePaginationReturn { page: number; totalPages: number; hasPrevious: boolean; hasNext: boolean; onPrevious: () => void; onNext: () => void; goToPage: (page: number) => void; label: string; } /** * Hook for managing pagination state and actions */ declare function usePagination({ page, limit, total, onPageChange, }: UsePaginationOptions): UsePaginationReturn; /** * Default fetch function that uses the browser's native fetch API */ declare const defaultFetch: (url: string, options?: RequestInit) => Promise; /** * Default translation function */ declare const defaultT: (key: string, options?: any) => string; export { ListTable, type QueryResult, type QueryState, type SelectionChangeHandler, type SortDefinition, type UseDataSourceOptions, type UseDataSourceReturn, type UsePaginationOptions, type UsePaginationReturn, type UseSelectionReturn, type ViewDefinition, defaultFetch, defaultT, useDataSource, usePagination, useSelection };