import { TypeaheadOption } from '../../typeahead';
/**
 * @typedef {Object} PaginationState
 * @property {number} pageSize - items per page
 * @property {number} currentPage - current page number
 * @property {number} total - total items count
 */
/**
 * @typedef Pagination
 * @property {number} pageSize - items per page
 * @property {number} currentPage - current page number
 * @property {number} total - total items count
 * @property {number} count - items count of the current page
 * @property {function} setPage - set current page
 * @property {function} setPageSize - set items per page
 * @property {function} setTotal - set total items count
 * @property {function} setCount - set current page's items count
 */
/**
 * Provides state and action for pagination components, doesn't control
 * state except for resetting page when page size or total changes
 * ```
  const pagination = usePaginationState();

  return (
    <PaginationControls
      total={pagination.total}
      count={pagination.count}
      currentPage={pagination.currentPage}
      pageSize={pagination.pageSize}
      availableSizes={[20, 50, 100]}
      onPageChange={pagination.setPage}
      onPageSizeChange={pagination.setPageSize()}
    />
  )
 ```
 * @param {PaginationState} initialState - initial values that will be applied
 * on mount
 * @returns {Pagination}
 */
export type PaginationStateProps = {
    currentPage: number;
    pageSize: number;
    total: number;
    count: number;
    setPage: (page: number) => void;
    setPageSize: (size: number) => void;
    setTotal?: (val: number) => void;
};
export type Config = {
    pageSize?: number;
    total?: number;
    count?: number;
    currentPage?: number;
};
export declare function usePaginationState(config: Config): PaginationStateProps;
/**
 * @typedef PaginatedItemsState
 * @property {array} items - visible items
 * @property {number} pageSize - items per page
 * @property {number} currentPage - current page number
 * @property {number} total - total items count
 * @property {number} count - items count of the current page
 * @property {function} setPage - set current page
 * @property {function} setPageSize - set items per page
 * @property {function} setTotal - set total items count
 * @property {function} setCount - set current page's items count
 */
/**
 * Pagination hook that provides slice of data for current page
 *
```
  const fullListOfItems = getALotOfItemsSomehow();

  const { items, ...pagination } = usePaginatedSearch(fullListOfItems);

  return (
    <React.Fragment>
      <PaginationControls
        total={pagination.total}
        count={pagination.count}
        currentPage={pagination.currentPage}
        pageSize={pagination.pageSize}
        availableSizes={[20, 50, 100]}
        onPageChange={pagination.setPage}
        onPageSizeChange={pagination.setPageSize()}
      />
      {items.map(item => <div key={item.id}>{item.name}</div>)}
    <React.Fragment>
  )
```
 * @param {array} items - any array of items that need to be paginated
 * @param {number} initialPageSize - initial page size, default is 20
 * @returns {PaginatedItemsState} - object that contains
 * items on current page and pagination state and actions
 */
export declare function usePagination(items: Array<TypeaheadOption>, initialPageSize?: number): PaginationStateProps;
