/**
 * Feature utils for Components.
 *
 * @internal
 */
import type WebScene from "../../WebScene.js";
import type MapClass from "../../Map.js";
import type FeatureLayer from "../../layers/FeatureLayer.js";
import type SubtypeGroupLayer from "../../layers/SubtypeGroupLayer.js";
import type Relationship from "../../layers/support/Relationship.js";
import type UtilityNetwork from "../../networks/UtilityNetwork.js";
import type Query from "../../rest/support/Query.js";
import type { RequestOptions } from "../../request/types.js";

/**
 * Finds a related layer for a given layer and relationship info.
 *
 * @param map - The map containing the layers.
 * @param layer - The layer to find relationships for.
 * @param relationship - The relationship info to use for finding related layers.
 * @returns The related layer, if found.
 * @internal
 */
export function findRelatedLayer(map: MapClass | WebScene, layer: any, relationship: Relationship): any | null | undefined;

/**
 * Determines if a layer is both relatable and feature-supported.
 *
 * @param layer - A layer to check.
 * @returns True if the layer is relatable and feature-supported.
 * @internal
 */
export function isRelatableFeatureSupportedLayer(layer: unknown): boolean;

/**
 * Determines if a layer supports relationships.
 *
 * @param layer - A layer to check.
 * @returns True if the layer is relatable.
 * @internal
 */
export function isRelatableLayer(layer: unknown): boolean;

/**
 * Determines if a layer is a feature-supported layer.
 *
 * @param layer - A layer to check.
 * @returns True if the layer is feature-supported.
 * @internal
 */
export function isFeatureSupportedLayer(layer: unknown): boolean;

/**
 * Used to find an instance of [UtilityNetwork](https://developers.arcgis.com/javascript/latest/api-reference/esri-networks-UtilityNetwork.html).
 *
 * @param map - Map that contains a [UtilityNetwork](https://developers.arcgis.com/javascript/latest/api-reference/esri-networks-UtilityNetwork.html).
 * @param layer - The layer being validated as a UtilityLayer.
 * @returns Returns a [UtilityNetwork](https://developers.arcgis.com/javascript/latest/api-reference/esri-networks-UtilityNetwork.html).
 * @internal
 */
export function findUtilityNetwork(map: MapClass, layer: any): UtilityNetwork | null | undefined;

/**
 * Used to query all JSON
 *
 * @param layer - The layer being passed.
 * @param query - -The query being used.
 * @param options - -The request options.
 * @returns Returns a FeatureSet.
 * @internal
 */
export function queryAllJSON(layer: FeatureLayer | SubtypeGroupLayer, query: Query, options?: RequestOptions): Promise<any>;

/**
 * Finds an item in the specified map or generates a new value if it does not exist.
 *
 * @param map - The map to search.
 * @param key - The key to look up.
 * @param createValue - Factory function that creates the value if the key does not exist.
 * @returns The existing value in the map, or a newly created value.
 * @internal
 */
export function getOrCreateMapValue(map: any, key: any, createValue: () => any): any;

/**
 * Used to generate a new reactive map that implements the Map interface.
 *
 * @returns A Map instance with reactivity features applied.
 * @internal
 */
export function createReactiveMap<Key, Value>(): Map<Key, Value>;