@esri/arcgis-rest-portal
Version:
ArcGIS Online and Enterprise content and user helpers for @esri/arcgis-rest-request
38 lines (37 loc) • 1.55 kB
TypeScript
import { IGroup } from "@esri/arcgis-rest-request";
import { IItem } from "../helpers.js";
import { SearchQueryBuilder } from "../util/SearchQueryBuilder.js";
import { ISearchOptions, ISearchGroupContentOptions, ISearchResult } from "../util/search.js";
/**
* Search a portal for groups. See the [REST Documentation](https://developers.arcgis.com/rest/users-groups-and-items/group-search.htm) for more information.
*
* ```js
* import { searchGroups } from "@esri/arcgis-rest-portal";
*
* searchGroups('water')
* .then(response) // response.total => 355
* ```
*
* @param search - A string or RequestOptions object to pass through to the endpoint.
* @returns A Promise that will resolve with the data from the response.
*/
export declare function searchGroups(search: string | ISearchOptions | SearchQueryBuilder): Promise<ISearchResult<IGroup>>;
/**
* Search a portal for items in a group. See the [REST Documentation](https://developers.arcgis.com/rest/users-groups-and-items/group-content-search.htm) for more information.
*
* ```js
* import { searchGroupContent } from "@esri/arcgis-rest-portal";
*
* searchGroupContent({
* q: 'water',
* groupId: 'abc123'
* })
* .then(response => {
* console.log(response.total);
* });
* ```
*
* @param options - An object containing search parameters.
* @returns A Promise that resolves to the search result containing items within the specified group.
*/
export declare function searchGroupContent(options: ISearchGroupContentOptions): Promise<ISearchResult<IItem>>;