import { IUser } from "@esri/arcgis-rest-request";
import { IGroup, SearchQueryBuilder } from "@esri/arcgis-rest-portal";
import { IPredicate, IQuery } from "./types/IHubCatalog";
import { Kilobyte } from "./types/types";
import { WellKnownCollection } from "./wellKnownCatalog";
import { LegacySearchCategory } from "./_internal/commonHelpers/isLegacySearchCategory";
import { IHubSite } from "../core/types/IHubSite";
import { IHubSearchResult } from "./types/IHubSearchResult";
/**
 * Construct a the full url to a group thumbnail
 *
 * - If the group has a thumbnail, construct the full url
 * - If the group is not public, append on the token (if passed in)
 * @param portalUrl
 * @param group
 * @param token
 * @returns
 */
export declare function getGroupThumbnailUrl(portalUrl: string, group: IGroup, token?: string): string;
/**
 * Construct a the full url to a user thumbnail
 *
 * - If the user has a thumbnail, construct the full url
 * - If the user is not public, append on the token
 * @param portalUrl
 * @param user
 * @param token
 * @returns
 */
export declare function getUserThumbnailUrl(portalUrl: string, user: IUser, token?: string): string;
/**
 * Function that can migrate a legacy search category to a wellknown
 * collection key. Useful when the caller has an unknown value that
 * could either be a search category or wellknown collection.
 *
 * If the value passed is not a search category, it is returned as-is.
 *
 * @param collectionOrSearchCategory key to be migrated
 * @returns the migrated wellknown collection key
 */
export declare function migrateToCollectionKey(collectionOrSearchCategory: LegacySearchCategory | WellKnownCollection): WellKnownCollection;
/**
 * DEPRECATED: Please use `getGroupPredicate`
 * Searches through a catalog scope and retrieves the predicate responsible
 * for determining group sharing requirements.
 * Still in use in opendata-ui as of 03/26/2025
 * @param scope Catalog scope to search through
 * @returns The first predicate with a `group` field (if present)
 */
export declare function getScopeGroupPredicate(scope: IQuery): IPredicate;
/**
 * Searches through an `IQuery` and retrieves the predicate with a `group` definition.
 * If there is no group predicate, returns `null`
 * @param query IQuery to search
 * @returns
 */
export declare function getGroupPredicate(query: IQuery): IPredicate;
/**
 * Determines the canonical siteRelative link for a search result.
 *
 * We need to pass in `site` specifically for Hub Page items. Unfortunately
 * for us, Hub Page items have their canonical slug stored in the corresponding
 * site's data.json, not within the Hub Page item itself.
 *
 * NOTE: The slugs generated by indexer for Hub Page items are not canonical
 * and should not be used for link generation.
 *
 * @param searchResult the search result we're calculating the link for
 * @param site IHubSite that is related to the result
 * @returns a canonical siteRelative link
 */
export declare function getResultSiteRelativeLink(searchResult: IHubSearchResult, site?: IHubSite): string;
/**
 * Adds default predicates for item target entity
 *
 * @param query IQuery to search items
 * @returns a cloned copy of the query object with default item search predicates
 */
export declare function addDefaultItemSearchPredicates(query: IQuery): IQuery;
/**
 * Returns the size in kilobytes of a query string or a SearchQueryBuilder.
 * This is used to later determine if a query is too large or almost too large to be sent to the server.
 * @param query
 * @returns
 */
export declare function getKilobyteSizeOfQuery(query: string | SearchQueryBuilder): Kilobyte;
/**
 * Expand an item IQuery for portal by applying well-known filters and predicates,
 * and then expanding all the predicates into IMatchOption objects.
 * @param query `IQuery` to expand
 * @returns IQuery
 */
export declare function expandPortalQuery(query: IQuery): IQuery;
