/** * @typedef Paginator * @property {function(number): void} setCurrentPage Sets the current index to the specific page. * @property {function(): number} getCurrentPage Gets the current page. * @property {function(): number} getSize Gets the total number of pages. * @property {function(): void} toFirstItem Move the index to the first page. * @property {function(): void} toLastItem Move the index to the last page. * @property {function(): void} toNextItem Move the index to the next page. * @property {function(): void} toPreviousItem Move the index to the previous page. * @property {function(): void} clear Clear the internal state of the paginator. */ /** * @param {object} options Paginator options. * @param {number} [options.initialPage] Initial index from which paging starts. Also, after clearing the paginator * the page is cleared to the initial page. * @param {function(): number} [options.size] Sets the max size of the pages. * @param {function(number): boolean | void} [options.onItemSelect] Fires the function on each page change. * @param {function(): void} [options.onClear] Fires the function after clearing the state. * @returns {Paginator} */ export declare function createPaginator({ initialPage, size, onItemSelect, onClear, }: { initialPage?: number | undefined; size?: (() => number) | undefined; onItemSelect?: ((index: number, commit: boolean) => boolean | void) | undefined; onClear?: (() => void) | undefined; }): { setCurrentPage: (index: number) => void; setPageCursorAt: (index: number) => void; getCurrentPage: () => number; toFirstItem: () => void; toLastItem: () => void; toNextItem: () => void; toPreviousItem: () => void; getSize: () => number; clear: () => void; };