import { Entity, EntitySchemaResolver, FilterValues } from "../../models"; /** * @category Hooks and utilities */ export interface CollectionFetchProps { /** * Absolute collection path */ path: string; /** * Schema of the entity displayed by this collection */ schemaResolver: EntitySchemaResolver; /** * Number of entities to fetch */ itemCount?: number; /** * List of entities that will be displayed on top, no matter the ordering. * This is used for reference fields selection */ entitiesDisplayedFirst?: Entity[]; /** * Filter the fetched data by the property */ filterValues?: FilterValues; /** * Sort the results by */ sortBy?: [Extract, "asc" | "desc"]; /** * Search string */ searchString?: string; } /** * @category Hooks and utilities */ export interface CollectionFetchResult { data: Entity[]; dataLoading: boolean; noMoreToLoad: boolean; dataLoadingError?: Error; } /** * This hook is used to fetch collections using a given schema * @param path * @param schemaResolver * @param filterValues * @param sortBy * @param itemCount * @param searchString * @param entitiesDisplayedFirst * @category Hooks and utilities */ export declare function useCollectionFetch({ path, schemaResolver, filterValues, sortBy, itemCount, searchString, entitiesDisplayedFirst }: CollectionFetchProps): CollectionFetchResult;