/**
 * Layer origin utils for Components.
 *
 * @experimental
 * @internal
 */
import type Layer from "../../layers/Layer.js";

/**
 * Indicates whether origin info can be returned for the given layer and its properties.
 *
 * @param layer
 * @experimental
 * @internal
 */
export function isSupportedLayer(layer: Layer): boolean;

/**
 * Clears property overrides in the given layer.
 *
 * Clears property values defined at the given origin or higher. After they are cleared,
 * these properties will reflect values defined at the layer source.
 *
 * See getLayerOriginInfo() description for an explanation of what constitutes a layer source.
 *
 * @param layer
 * @param origin
 * @experimental
 * @internal
 */
export function clearOverrides(layer: Layer, origin: "portal-item" | "web-map" | "web-scene"): void;

/**
 * Disconnects the given layer from its source.
 *
 * Updates the origin of properties that currently get their values from the layer source,
 * to the given origin. This will not result in any visible changes to the layer. However,
 * after a layer is disconnected from its source, it stops reflecting changes from the source.
 *
 * See getLayerOriginInfo() description for an explanation of what constitutes a layer source.
 *
 * @param layer
 * @param origin
 * @experimental
 * @internal
 */
export function disconnectFromSource(layer: Layer, origin: "portal-item" | "web-map" | "web-scene"): void;

/**
 * Returns origin information for properties of the given layer and overall status of the layer.
 *
 * Origin status for each property indicates whether its current value is defined at the layer
 * source or defined at the given origin or higher (i.e. overridden). Note that the set of
 * origins that have lower priority than the given origin is collectively considered
 * to be the "layer source". For example:
 *
 * When the given origin is "web-map", properties that have origin lower than "web-map"
 * (i.e. portal-item, service) are considered as getting their values from the layer source.
 * Properties that have "web-map" or "user" origin are considered to be overridden.
 *
 * When the given origin is "portal-item", properties that have origin lower than "portal-item"
 * (i.e. service) are considered as getting their values from the layer source. Properties that
 * have "portal-item", "web-map" or "user" origin are considered to be overridden.
 *
 * The overall status of the layer indicates whether all properties of the layer get their
 * values from the source, or overridden at the given origin, or they are in a mixed state
 * where some properties get their values from the source and some have overridden values.
 *
 * @param layer
 * @param origin
 * @experimental
 * @internal
 */
export function getLayerOriginInfo(layer: Layer, origin: "portal-item" | "web-map" | "web-scene"): object | null | undefined;