/**
 * Provides utility functions for the [OGCFeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-OGCFeatureLayer.html).
 *
 * @since 5.0
 * @see [OGCFeatureLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-OGCFeatureLayer.html)
 */
import type { CollectionsPage, LandingPage, QueryOptions } from "./types.js";

/**
 * Returns an array of feature collections available on the server.
 *
 * @param landingPage - An OGC API-Feature server landing page.
 * @param options - Additional options.
 * @returns A promise that resolves to the server's collections page.
 * @see [getServerLandingPage()](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ogc-ogcFeatureUtils.html#getServerLandingPage)
 * @example
 * // Print the ids and titles of all collections published to the ogc-api features server.
 * const url = "https://demo.ldproxy.net/daraa";
 *
 * const ogcFeatureUtils = await $arcgis.import("@arcgis/core/layers/ogc/ogcFeatureUtils.js");
 * const landingPage = await ogcFeatureUtils.getServerLandingPage(url);
 * const collectionsPage = await ogcFeatureUtils.getServerCollectionsPage(landingPage);
 * for (const collection of collectionsPage.collections) {
 *   const { id, title } = collection;
 *   console.log(`
 *     Collection id:    ${id}
 *     Collection title: ${title ?? "not specified"}
 *   `);
 * }
 */
export function getServerCollectionsPage(landingPage: LandingPage, options?: QueryOptions): Promise<CollectionsPage>;

/**
 * Returns the landing page for an OGC API-Features server.
 *
 * @param url - The URL to an OGC API-Features server.
 * @param options - Additional options.
 * @returns A promise that resolves to the server's landing page.
 *
 * > [!WARNING]
 * >
 * > The url that returns the json representation of the landing page may or may not include query parameters, for
 * > example, "f=json". This function does not append any query parameters to the provided url. If the server requires
 * > specific query parameters to return the landing page, please ensure they are included in the provided url.
 * @example
 * // Print the title and description of the server landing page to console.
 * const url = "https://demo.ldproxy.net/daraa";
 *
 * const ogcFeatureUtils = await $arcgis.import("@arcgis/core/layers/ogc/ogcFeatureUtils.js");
 * const landingPage = await ogcFeatureUtils.getServerLandingPage(url);
 * const { description, title } = landingPage;
 * console.log(`
 *   Title:       ${title ?? "not specified"}
 *   Description: ${description ?? "not specified"}
 * `);
 */
export function getServerLandingPage(url: string, options?: QueryOptions): Promise<LandingPage>;