import { Entity, FilterValues, User } from "@rebasepro/types"; import type { AdminCollection } from "@rebasepro/cms-types"; /** * @group Hooks and utilities */ export interface CollectionProps> { /** * Absolute collection path */ path: string; /** * collection of the entity displayed by this collection */ collection: AdminCollection; /** * Number of entities to fetch */ itemCount?: number; /** * Number of items to skip */ offset?: number; /** * Page number (1-indexed), alternative to offset */ page?: number; /** * Filter the fetched data by the property */ filterValues?: FilterValues>; /** * Sort the results by */ sortBy?: [Extract, "asc" | "desc"]; /** * Search string */ searchString?: string; } /** * @group Hooks and utilities */ export interface CollectionResult> { data: Entity[]; dataLoading: boolean; noMoreToLoad: boolean; dataLoadingError?: Error; totalCount?: number; } /** * This hook is used to fetch collections using a given collection * @param path * @param collection * @param filterValues * @param sortBy * @param itemCount * @param offset * @param page * @param searchString * @group Hooks and utilities */ export declare function useCollection, USER extends User>({ path, collection, filterValues, sortBy, itemCount, offset, page, searchString }: CollectionProps): CollectionResult;