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 { InitializableCollection } from "../../support/InitializableCollectionProxy.js";
import { InitializableCollectionProxy } from "../../support/InitializableCollectionProxy.js";
import type { SublayerLike } from "../../support/esri.js";
import { type Observable } from "../../support/observableUtils.js";
import type { LayerExtension } from "../_LayerExtension.js";
import type { SublayerExtensionProperties } from "../_SublayerExtension.js";
import { SublayerExtension } from "../_SublayerExtension.js";
/**
 * A collection of sublayer extensions belonging to a LayerExtension or
 * SublayerExtension.
 */
export interface SublayerExtensionCollection extends InitializableCollection<SublayerExtensionProperties, SublayerExtension> {
    /**
     * Get the sublayer extension for a given id.
     *
     * @param id The id of the sublayer extension.
     * @returns The sublayer extension.
     */
    findById(id: string): SublayerExtension;
    /**
     * Get the corresponding sublayer extension for a given sublayer id.
     *
     * @param id The id of the sublayer.
     * @returns The corresponding sublayer extension.
     */
    findBySublayerId(id: number | string): SublayerExtension;
    /**
     * Gets the corresponding sublayer extension for a given sublayer.
     *
     * @param sublayer A sublayer.
     * @returns The corresponding sublayer extension.
     */
    forSublayer(sublayer: SublayerLike): SublayerExtension;
}
/**
 * Backing implementation of
 * {@link mapping/support/_SublayerExtensionCollection!SublayerExtensionCollection}.
 * Used by LayerExtension and SublayerExtension.
 */
export declare abstract class SublayerExtensionCollectionBase extends InitializableCollectionProxy<SublayerExtensionProperties, SublayerExtension> implements SublayerExtensionCollection {
    /**
     * The layer extension that the collection of sublayers is associated with.
     */
    protected abstract get _layerExtension(): LayerExtension;
    /**
     * The parent that owns this collection.
     */
    protected readonly _parent: Observable;
    protected get _collection(): Collection<SublayerExtension>;
    private get _sublayers();
    private readonly _sublayersProperty;
    /**
     * Used when the backing collection of sublayers isn't available yet.
     */
    private _tempSublayers;
    /**
     * Associates sublayers with sublayer extensions.
     */
    private _sublayerExtensionMap;
    /**
     * Keeps track of sublayer extensions that were explicitly added, but whose
     * "sublayer" property is undefined. This can occur when the sublayer
     * extension is not yet initialized. We still need to track these for later
     * when the sublayer extension is initialized.
     */
    private readonly _uninitializedSublayerExtensions;
    private readonly _onChangeSublayersHandle;
    private readonly _onBeforeAddSublayersHandle;
    private readonly _onBeforeRemoveSublayersHandle;
    private readonly _onBeforeChangesSublayersHandle;
    private readonly _onAfterAddSublayersHandle;
    private readonly _onAfterRemoveSublayersHandle;
    private readonly _onAfterChangesSublayersHandle;
    /**
     * Creates a new instance of SublayerExtensionCollectionBase.
     *
     * @param parent The parent object that owns the collection of sublayers.
     * @param sublayersProperty The name of a property (or property path) on the
     *   parent corresponding to the underlying collection of sublayers.
     */
    constructor(parent: Observable, sublayersProperty: string);
    on<Type extends EventNames<this>>(eventName: Type, listener: EventedCallback<this["@eventTypes"][Type]>): ResourceHandle;
    clone(): SublayerExtensionCollectionBase;
    /**
     * @inheritDoc
     */
    findById(id: string): SublayerExtension;
    /**
     * @inheritDoc
     */
    findBySublayerId(id: number | string): SublayerExtension;
    /**
     * @inheritDoc
     */
    forSublayer(sublayer: SublayerLike): SublayerExtension;
    add(sublayerX: SublayerExtension, index?: number): this;
    removeAt(index: number): SublayerExtension;
    reorder(sublayerX: SublayerExtension, index: number): SublayerExtension;
    sort(compareFunction?: (a: SublayerExtension, b: SublayerExtension) => number): this;
    /**
     * Invoked by the parent object when it is initialized.
     */
    onParentInitialized(): void;
    /**
     * Invoked by the parent whenever the associated layer extension is updated.
     */
    onLayerExtensionChanged(): void;
    protected _itemIsInitialized(item: SublayerExtension): boolean;
    /**
     * Invoked whenever a sublayer extension is added.
     *
     * @param sublayerExtension The new sublayer extension.
     */
    protected _onAdded(sublayerExtension: SublayerExtension): void;
    /**
     * Invoked whenever a sublayer extension is removed.
     *
     * @param sublayerExtension The sublayer extension that was removed.
     */
    protected _onRemoved(sublayerExtension: SublayerExtension): void;
    private _forSublayer;
}
