import { Ref } from 'vue'; import { QuerySerializationStrategy } from '../types/QuerySerializationStrategies/QuerySerializationStrategy'; import { default as ApiInterface } from '../types/api-interface'; import { default as DataProviderInterface } from '../types/data-provider-interface'; export interface OnLoadEventInterface { allItems: any[]; loadedItems: any[]; unloadedItems: any[]; } export interface PaginatedApiOptions { endpoint: string; countEndpoint?: string; useAsyncCountLoad?: boolean; params: Ref>; api?: ApiInterface; dataProvider?: DataProviderInterface; inMemorySize?: number; sortField?: Ref; paginationType?: string; requestSize?: Ref; paramsSerialization?: paramsSerializationOptions; usePrevNextFlags?: boolean; prevPageFlagKey?: string; nextPageFlagKey?: string; sortFieldKey?: string; requestPageKey?: string; responseItemsKey?: string; responseTotalKey?: string; requestPerPageKey?: string; itemConverter?: (item: any) => T; autoReload?: boolean; queryParamsSerializationStrategy?: QuerySerializationStrategy; onLoadPrev?: Array<(options: OnLoadEventInterface) => void>; onLoadNext?: Array<(options: OnLoadEventInterface) => void>; onInitialLoad?: Array<(options: OnLoadEventInterface) => void>; debug?: boolean; } export type paramsSerializationOptions = 'default' | 'custom' | 'comma'; export default function useEndlessScrollApi(options: PaginatedApiOptions): { loadNext: () => Promise; loadPrev: () => Promise; reload: () => Promise; refresh: any; load: (offset: number, limit: number) => Promise; initialLoad: () => Promise; clear: () => void; items: Ref; isLoading: any; isCountLoading: any; count: any; offset: any; startOffset: any; endOffset: any; getCount: () => Promise; hasNextPage: any; hasPrevPage: any; };