import type { GroupKey } from "@arcgis/core/core/Accessor.js";
import type Collection from "@arcgis/core/core/Collection";
import type { CollectionEvents, ItemCallback, ReadonlyArrayOrCollection } from "@arcgis/core/core/Collection";
import { Evented } from "@arcgis/core/core/Evented.js";
import type { ItemCompareCallback, ItemMapCallback, ItemReduceCallback, ItemTestCallback } from "../support/esri.js";
import { type IHandle } from "../support/observableUtils.js";
/**
 * Merge typings of Collection and CollectionProxy.
 */
export interface CollectionProxy<T> extends Collection<T> {
}
/**
 * Options for the CollectionProxy constructor.
 */
export interface CollectionProxyOptions {
    /**
     * If true, destroy will also destroy the wrapped collection.
     */
    destroyBackingCollection?: boolean;
}
declare const CollectionProxy_base: abstract new (...args: any[]) => Evented & import("../support/observableUtils.js").ObservableMixin & import("../support/HandlesMixin.js").HandlesMixin<void>;
/**
 * Base class for implementing a Collection proxy, i.e. a class that wraps an
 * existing collection and provides additional functionality or logic. The
 * default implementations of each method and property accessor simply forward
 * to the wrapped collection. Methods that add or remove elements from the
 * collection are implemented in terms of add() and removeAt(), so subclasses
 * that need to implement special add/remove logic only need to those methods.
 */
export declare abstract class CollectionProxy<T> extends CollectionProxy_base implements Collection<T> {
    /**
     * @deprecated Do not directly reference this property. Use EventNames and
     *   EventTypes helpers from @arcgis/core/Evented.
     */
    "@eventTypes": CollectionEvents<T>;
    /**
     * The declared class name. This is always `"esri.core.Collection"` for
     * compatibility with Esri's API.
     */
    declaredClass: string;
    /**
     * The number of items in the collection.
     */
    get length(): number;
    /**
     * Whether the collection has been destroyed.
     */
    get destroyed(): boolean;
    set destroyed(value: boolean);
    /**
     * Whether the collection has been initialized.
     */
    get initialized(): boolean;
    set initialized(value: boolean);
    /**
     * The underlying collection that this class delegates to.
     */
    protected get _collection(): Collection<T>;
    protected set _collection(collection: Collection<T>);
    private _destroyed;
    private _initialized;
    private _collectionField;
    private _destroyBackingCollection;
    /**
     * Initializes a new instance of the
     * {@link utilities/CollectionProxy!CollectionProxy} class.
     *
     * @param collection The underlying collection to delegate to, or a function
     *   that produces the underlying collection.
     * @param options Controls lifecycle behavior for the wrapped collection.
     */
    constructor(collection?: Collection<T>, options?: CollectionProxyOptions);
    /**
     * @inheritDoc
     */
    [Symbol.iterator](): IterableIterator<T>;
    /**
     * Adds a single item to the collection.
     *
     * @param item The item to add.
     * @param index Zero-based index of where in the collection to add the item.
     *   If not specified, the items will be added at the end.
     */
    add(item: T, index?: number): this;
    /**
     * Adds multiple items to the collection.
     *
     * @param items An array or collection of items to add.
     * @param index Zero-based index of where in the collection to add the
     *   items. If not specified, the items will be added at the end.
     */
    addMany(items: ReadonlyArrayOrCollection<T>, index?: number): this;
    /**
     * Creates a deep clone of the Collection. To create a shallow clone of the
     * collection, use slice().
     */
    clone(): Collection<T>;
    /**
     * Creates a new Collection containing the items in the original Collection
     * joined with the items in the input array or Collection.
     *
     * @param value The array or Collection to append to the existing
     *   Collection.
     */
    concat(value: T[] | Collection<T>): Collection<T>;
    /**
     * @inheritdoc
     */
    destroyAll(): void;
    /**
     * @inheritdoc
     */
    destroyMany(items: ReadonlyArrayOrCollection<T>): T[];
    /**
     * @inheritdoc
     */
    drain(callback: ItemCallback<T>, thisArg?: any): void;
    /**
     * Removes all event listeners and destroys the collection.
     */
    destroy(): void;
    /**
     * Determines whether all items in the Collection pass a test defined by
     * callback. Each item in the Collection is passed into the callback until
     * one returns a value of false.
     *
     * @param callback The function to call for each item in the Collection.
     */
    every(callback: ItemTestCallback<T>): boolean;
    /**
     * Filters the Collection's items based on a test defined by the callback
     * function. Each item is passed into the callback function, which returns
     * true if the item passes the test and false if it does not.
     *
     * @param callback The function that defines a test for determining whether
     *   to return the item in a new Collection.
     */
    filter(callback: ItemTestCallback<T>): Collection<T>;
    /**
     * Returns an item in the Collection if that item passes a test as defined
     * in the callback function. Each item is passed into the callback function,
     * which returns true if the item passes the test and false if it does not.
     *
     * @param callback The testing function that will assess each item in the
     *   Collection. Returns true if an item passes the test and false if it
     *   fails.
     */
    find(callback: ItemTestCallback<T>): T | undefined;
    /**
     * Returns the index of an item in the Collection if that item passes a test
     * as defined in the callback function. Each item is passed into the
     * callback function, which returns true if the item passes the test and
     * false if it does not.
     *
     * @param callback The testing function that will assess each item in the
     *   Collection. Returns true if an item passes the test and false if it
     *   fails.
     * @returns Returns the index of the Collection item that satisfies the test
     *   function. If an item fails the test, -1 is returned.
     */
    findIndex(callback: ItemTestCallback<T>): number;
    /**
     * Flattens a hierarchical Collection containing at least one child
     * collection. Each item in the collection is passed into the callback
     * function, which should check for child collections specified by the
     * developer. A flat collection of all items (parent and children) is
     * returned.
     *
     * @param callback A function that will assess each item in the Collection.
     */
    flatten(callback: (item: T, index: number) => T[] | Collection<T>): Collection<T>;
    /**
     * Executes the input function for each item in the Collection.
     *
     * @param callback The function to call for each item in the Collection.
     */
    forEach(callback: ItemCallback<T>): void;
    /**
     * Returns the item at the specified index.
     *
     * @param index Zero-based index of the item in the Collection to retrieve.
     * @returns The item in the Collection stored at the specified index.
     */
    at(index: number): T | undefined;
    /**
     * Returns the item at the specified index.
     *
     * @param index Zero-based index of the item in the Collection to retrieve.
     * @returns The item in the Collection stored at the specified index.
     */
    getItemAt(index: number): T | undefined;
    /**
     * Tests if an item is present in the Collection.
     *
     * @param searchElement The item to search for in the collection.
     */
    includes(searchElement: T): boolean;
    /**
     * Returns the index of an element in the collection.
     *
     * @param searchElement Item to search for in the collection.
     * @param fromIndex Use if you don't want to search the whole collection or
     *   you don't want to search from the start.
     */
    indexOf(searchElement: T, fromIndex?: number): number;
    /**
     * Creates a string representation of the items in the Collection.
     *
     * @param separator The separator used between each item in the final
     *   string. The default is ",".
     */
    join(separator?: string): string;
    /**
     * Returns the last index of an element in the collection.
     *
     * @param searchElement Item to search for in the collection.
     * @param fromIndex Use if you don't want to search the whole collection, or
     *   you don't want to search from the end.
     * @returns The location of the last match found in the collection, or -1 if
     *   there is no match.
     */
    lastIndexOf(searchElement: T, fromIndex?: number): number;
    /**
     * Passes each Collection item into the callback function and returns a new
     * array of the returned values.
     *
     * @param callback The function that processes each item in the Collection
     *   and returns a new value at the same index of the original item.
     */
    map<U>(callback: ItemMapCallback<T, U>): Collection<U>;
    /**
     * Removes the last item from the collection and returns it.
     */
    pop(): T | undefined;
    /**
     * Adds an item to the end of the collection.
     *
     * @param item The item to add.
     */
    push(item: T): number;
    /**
     * Reduces all items in the collection (from left to right) into a single
     * variable using callback.
     *
     * @param callback The function that processes each item in the Collection
     *   and appends it to the previous item.
     * @param initialValue Item to use as the first element to process in
     *   callback.
     */
    reduce<U>(callback: ItemReduceCallback<T, U>, initialValue?: U): U;
    /**
     * Reduces all items in the collection (from right to left) into a single
     * variable using callback.
     *
     * @param callback The function that processes each item in the Collection
     *   and appends it to the previous item.
     * @param initialValue Item to use as the first element to process in
     *   callback.
     */
    reduceRight<U>(callback: ItemReduceCallback<T, U>, initialValue?: U): U;
    /**
     * Removes an item from the collection.
     *
     * @param item The item to remove.
     */
    remove(item: T): T | undefined;
    /**
     * Removes all items from the collection.
     */
    removeAll(): T[];
    /**
     * Removes an item from the collection at a specified index.
     *
     * @param index The index of the element to remove.
     */
    removeAt(index: number): T | undefined;
    /**
     * Removes each item in the input array. If an item is present multiple
     * times in the collection, only the first occurrence is removed.
     *
     * @param items The items to remove.
     */
    removeMany(items: ReadonlyArrayOrCollection<T>): T[];
    /**
     * Moves an item in the Collection to a specified index. The change event is
     * fired after an item is moved in the Collection.
     *
     * @param item The item to move.
     * @param index The index to move the item to.
     */
    reorder(item: T, index: number): T | undefined;
    /**
     * Reverses the collection in place.
     */
    reverse(): this;
    /**
     * Removes the first item from the collection (at index 0), and returns it.
     * The remaining items of the collection are then shifted down one index
     * from their previous location.
     */
    shift(): T | undefined;
    /**
     * Creates a new Collection comprised of a portion of the original
     * Collection.
     *
     * @param begin The index of the first item to extract.
     * @param end The index of the last item to extract.
     */
    slice(begin?: number, end?: number): Collection<T>;
    /**
     * Determines whether an item in the Collection passes a test defined by
     * callback. Each item in the Collection is passed into the callback until
     * one returns a value of true.
     *
     * @param callback The function that defines the test for each Collection
     *   item.
     */
    some(callback: ItemTestCallback<T>): boolean;
    /**
     * Sorts the Collection in place.
     *
     * @param compareFunction The function that defines a comparison of two
     *   items in the collection.
     */
    sort(compareFunction?: ItemCompareCallback<T>): this;
    /**
     * Removes existing items and/or adds new items to the collection.
     *
     * @param start Index at which to start changing the collection.
     * @param deleteCount Indicates the number of collection items to remove. If
     *   0 is used then no elements are removed and at least one new item should
     *   be added in the items parameter.
     * @param items The item or comma-separated list of items to add to the
     *   collection.
     * @returns An array of the deleted items formerly part of the collection.
     */
    splice(start: number, deleteCount: number, ...items: T[]): T[];
    /**
     * Returns a new array object containing the Collection's items.
     */
    toArray(): T[];
    /**
     * Adds an item to the beginning of the collection.
     *
     * @param item The item to add.
     */
    unshift(item: T): number;
    /**
     * @deprecated - Unsupported on CollectionProxy.
     * @inheritdoc
     */
    set<T>(propertyPath: string, value: T): this;
    /**
     * @deprecated - Unsupported on CollectionProxy.
     * @inheritdoc
     */
    set(properties: HashMap<unknown>): this;
    /**
     * @deprecated - Unsupported on CollectionProxy.
     * @inheritdoc
     */
    get<T>(propertyPath: string): T;
    /**
     * @deprecated - Unsupported on CollectionProxy.
     * @inheritdoc
     */
    get(propertyPath: string): unknown;
    /**
     * @deprecated - Unsupported on CollectionProxy.
     * @inheritdoc
     */
    watch(path: string | string[], callback: (newValue: any, oldValue: any, propertyName: string, target: any) => void, sync?: boolean): IHandle;
    /**
     * @inheritdoc
     */
    addHandles<T>(handles: IHandle | IHandle[], groupKey?: GroupKey<T>): void;
    /**
     * @inheritdoc
     */
    removeHandles<T>(groupKey?: GroupKey<T>): void;
    /**
     * @inheritdoc
     */
    hasHandles<T>(groupKey?: GroupKey<T>): boolean;
    /**
     * @deprecated - Unsupported on CollectionProxy.
     * @inheritdoc
     */
    protected notifyChange(propertyKey: string): void;
    protected notifyChange(propertyKey: keyof this): void;
    /**
     * @deprecated - Unsupported on CollectionProxy.
     * @inheritdoc
     */
    protected _get(propertyName: string): any;
    protected _get<T>(propertyName: string): T;
    /**
     * @deprecated - Unsupported on CollectionProxy.
     * @inheritdoc
     */
    protected _set<T>(propertyName: string, value: T): this;
    private _addForwardingEvents;
}
export {};
