import { FilterFunction } from '../use-filter-options';
export type SearchState = {
    searchQuery?: string;
    pageSize?: number;
    total?: number;
    count?: number;
    currentPage?: number;
};
export declare function usePaginatedSearchState(config: SearchState): {
    searchQuery: string;
    setSearchQuery: (query: string) => void;
    currentPage: number;
    pageSize: number;
    total: number;
    count: number;
    setPage: (page: number) => void;
    setPageSize: (size: number) => void;
    setTotal?: ((val: number) => void) | undefined;
};
/**
 * @typedef PaginatedSearch
 * @property {array} items
 * @property {array} unpaginatedFilteredItems - all items passed through search filter, unpaginated
 * @property {number} pageSize - items per page
 * @property {number} currentPage - current page number
 * @property {number} total - total items count
 * @property {string} searchValue
 * @property {function} setPage
 * @property {function} setPageSize
 * @property {function} setTotal
 * @property {func} setSearchValue
 * */
export type PaginatedSearchOptions = {
    searchFields: string[];
    filterFunction?: FilterFunction;
    defaultPageSize?: number;
};
/**
 * A hook that combines filtering and pagination for an array of items
 *
 * @param {array} [items=[]] Array of items that should be filtered
 * and paginated
 * @param {options} {
 *     searchFields = ['name'],
 *     filterFunction,
 *     paginationDefaults,
 *   } - options to configure search and provide
 * initial state for pagination, can be undefined
 * @returns {PaginatedSearch} - object containing filtered items,
 * pagination hook state and search query
 */
export declare function usePaginatedSearch(items?: never[], { searchFields, filterFunction, defaultPageSize, }?: PaginatedSearchOptions): {
    unpaginatedFilteredItems: import("../..").TypeaheadOption[];
    searchValue: string;
    setSearchValue: (newSearchValue: string) => void;
    currentPage: number;
    pageSize: number;
    total: number;
    count: number;
    setPage: (page: number) => void;
    setPageSize: (size: number) => void;
    setTotal?: ((val: number) => void) | undefined;
};
/**
 * Example:
 ```
  const fullListOfItems = getALotOfItemsSomehow();
  const {
    items,
    searchValue,
    total,
    currentPage,
    pageSize,
    setSearchValue,
    setPage,
    setPageSize,
  } = usePaginatedSearch(fullListOfItems);

  return (
    <React.Fragment>
      <Search value={searchValue} onChange={setSearchValue} />
      <PaginationControls
        total={total}
        currentPage={currentPage}
        pageSize={pageSize}
        availableSizes={[20, 50, 100]}
        onPageChange={setPage}
        onPageSizeChange={setPageSize}
      />
      {items.map(item => (
        <div key={item.id}>{item.name}</div>
      ))}
    </React.Fragment>
  );
 ```
 */
