/**
 * Provides utility methods for creating [FeatureServices](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-featureService-FeatureService.html).
 *
 * @since 4.28
 */
import type FeatureLayer from "../../layers/FeatureLayer.js";
import type GroupLayer from "../../layers/GroupLayer.js";
import type SubtypeGroupLayer from "../../layers/SubtypeGroupLayer.js";
import type { FeatureServiceResourcesBundle } from "./types.js";

/**
 * Used to create an instance of [FeatureService](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-featureService-FeatureService.html) from an array of [FeatureLayers](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html).
 *
 * @param layers - Layers used to construct the FeatureService.
 * @example
 * const layer1 = new FeatureLayer({url: `${defaultHost}/arcgis/rest/services/TestService/FeatureServer/12`});
 * const layer2 = new FeatureLayer({url: `${defaultHost}/arcgis/rest/services/TestService/FeatureServer/13`});
 * const layers = [layer1, layer2];
 * const mapOfServices = createFeatureServices(layers);
 *
 * //loading featureService from map object.
 * const featureService = await mapOfServices.get(`yourFeatureServiceLink/arcgis/rest/services/TestService/FeatureServer`).featureService.load();
 */
export function createFeatureServices(layers: Iterable<FeatureLayer | SubtypeGroupLayer | GroupLayer>): Map<string, FeatureServiceResourcesBundle>;