import Collection from "@arcgis/core/core/Collection";
import type { EventedCallback, EventNames } from "@arcgis/core/core/Evented.js";
import type { ResourceHandle } from "@arcgis/core/core/Handles.js";
import type Layer from "@arcgis/core/layers/Layer";
import type { InitializableCollection } from "../../support/InitializableCollectionProxy.js";
import { InitializableCollectionProxy } from "../../support/InitializableCollectionProxy.js";
import { type Observable } from "../../support/observableUtils.js";
import type { MapExtension } from "../MapExtension.js";
import type { LayerExtensionProperties } from "../_LayerExtension.js";
import { LayerExtension } from "../_LayerExtension.js";
/**
 * A collection of layer extensions.
 */
export interface LayerExtensionCollection<TProps extends LayerExtensionProperties = LayerExtensionProperties> extends InitializableCollection<LayerExtensionProperties, LayerExtension> {
    /**
     * Get the layer extension for a given id.
     *
     * @param id The id of the layer extension.
     * @returns The layer extension.
     */
    findById(id: string): LayerExtension<TProps>;
    /**
     * Get the corresponding layer extension for a given layer id.
     *
     * @param id The id of the layer.
     * @returns The corresponding layer extension.
     */
    findByLayerId(id: string): LayerExtension<TProps>;
    /**
     * Gets the corresponding layer extension for a given layer.
     *
     * @param layer A layer on the map.
     * @returns The corresponding layer extension.
     */
    forLayer(layer: Layer): LayerExtension<TProps>;
}
/**
 * Backing implementation for
 * {@link mapping/support/_LayerExtensionCollection!LayerExtensionCollection}.
 */
export declare abstract class LayerExtensionCollectionBase extends InitializableCollectionProxy<LayerExtensionProperties, LayerExtension> implements LayerExtensionCollection {
    /**
     * The parent MapExtension of LayerExtensions in this collection.
     */
    protected abstract get _mapExtension(): MapExtension;
    /**
     * The parent that owns this collection.
     */
    protected readonly _parent: Observable;
    protected get _collection(): Collection<LayerExtension>;
    /**
     * The backing collection of layers that this collection is based on.
     */
    protected get _layers(): Collection<Layer>;
    /**
     * Associates layers with layer extensions.
     */
    protected _layerExtensionMap: WeakMap<Layer, LayerExtension>;
    /**
     * Keeps track of layer extensions that were explicitly added, but whose
     * "layer" property is undefined. This can occur when the layer extension is
     * not yet initialized or represents an offline layer.
     */
    protected readonly _uninitializedLayerExtensions: Collection<LayerExtension>;
    private readonly _layersProperty;
    /**
     * Used when the backing collection of layers isn't available yet.
     */
    private _tempLayers;
    private readonly _onChangeLayersHandle;
    private readonly _onBeforeAddLayersHandle;
    private readonly _onBeforeRemoveLayersHandle;
    private readonly _onBeforeChangesLayersHandle;
    private readonly _onAfterAddLayersHandle;
    private readonly _onAfterRemoveLayersHandle;
    private readonly _onAfterChangesLayersHandle;
    /**
     * Creates a new instance of LayerExtensionCollectionBase.
     *
     * @param parent The parent object that owns the collection of layers.
     * @param layersProperty The name of a property (or property path) on the
     *   parent corresponding to the underlying collection of layers.
     */
    constructor(parent: Observable, layersProperty: string);
    on<Type extends EventNames<this>>(eventName: Type, listener: EventedCallback<this["@eventTypes"][Type]>): ResourceHandle;
    clone(): LayerExtensionCollectionBase;
    /**
     * @inheritDoc
     */
    findById(id: string): LayerExtension;
    /**
     * @inheritDoc
     */
    findByLayerId(id: string): LayerExtension;
    /**
     * @inheritDoc
     */
    forLayer(layer: Layer): LayerExtension;
    add(layerX: LayerExtension, index?: number): this;
    removeAt(index: number): LayerExtension;
    reorder(layerX: LayerExtension, index: number): LayerExtension;
    sort(compareFunction?: (a: LayerExtension, b: LayerExtension) => number): this;
    /**
     * Invoked by the parent object when it is initialized.
     */
    onParentInitialized(): void;
    /**
     * Invoked by the parent whenever the associated map extension is updated.
     */
    onMapExtensionChanged(): void;
    protected _itemIsInitialized(item: LayerExtension): boolean;
    /**
     * Invoked when a layer extension is added.
     *
     * @param layerX The newly added layer extension.
     */
    protected _onAdded(layerX: LayerExtension): void;
    /**
     * Invoked when a layer extension is removed.
     *
     * @param layerX The layer extension that was removed.
     */
    protected _onRemoved(layerX: LayerExtension): void;
}
