import Collection from "@arcgis/core/core/Collection";
import type ArcGISSublayer from "@arcgis/core/layers/support/Sublayer";
import type { RendererUnion } from "@arcgis/core/renderers/types.js";
import type { Attachment } from "../data/Attachment.js";
import type { Feature } from "../data/Feature.js";
import type { FeatureSettings } from "../data/FeatureSettings.js";
import type { FeatureReadOptions, FeatureSource } from "../data/FeatureSource.js";
import type { QuerySourceCapabilities } from "../data/QuerySourceCapabilities.js";
import type { Schema } from "../data/Schema.js";
import type { Relationship } from "../data/_Relationship.js";
import { type SublayerJson } from "../json/SublayerJson.js";
import type { ArcGISRequestHelper } from "../support/ArcGISRequestHelper.js";
import type { InitializableCollection } from "../support/InitializableCollectionProxy.js";
import type { PropertyDefs } from "../support/Serializable.js";
import { ArcGISRelationshipCollection } from "../support/_ArcGISRelationshipCollection.js";
import type { SublayerLike } from "../support/esri.js";
import type { SublayerExtensionProperties, SublayerProperties } from "./_SublayerExtension.js";
import { SublayerExtension } from "./_SublayerExtension.js";
import type { LayerListSettings, LayerListSettingsProperties } from "./support/LayerListSettings.js";
/**
 * Properties that can be specified for the
 * {@link ArcGISSublayerExtensionProperties.sublayer} property.
 */
export interface ArcGISSublayerProperties extends SublayerProperties, SublayerJson {
}
/**
 * Properties that can be passed into the constructor for
 * {@link ArcGISSublayerExtension}.
 */
export interface ArcGISSublayerExtensionProperties extends SublayerExtensionProperties {
    /**
     * See {@link mapping/_SublayerExtension!SublayerExtension.sublayer}.
     */
    sublayer?: ArcGISSublayer | ArcGISSublayerProperties;
    /**
     * See
     * {@link mapping/_SublayerExtension!SublayerExtension.sublayerExtensions}.
     */
    sublayerExtensions?: (ArcGISSublayerExtension | ArcGISSublayerExtensionProperties)[];
    /**
     * See
     * {@link mapping/ArcGISSublayerExtension!ArcGISSublayerExtension.requestHelper}.
     */
    requestHelper?: ArcGISRequestHelper;
}
/**
 * A collection of sublayer extensions belonging to a ArcGISLayerExtension.
 */
export interface ArcGISSublayerExtensionCollection<S extends ArcGISSublayerExtension> extends InitializableCollection<ArcGISSublayerExtensionProperties, ArcGISSublayerExtension> {
    /**
     * Get the sublayer extension for a given id.
     *
     * @param id The id of the sublayer extension.
     * @returns The sublayer extension.
     */
    findById(id: string): S;
    /**
     * 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): S;
    /**
     * Gets the corresponding sublayer extension for a given sublayer.
     *
     * @param sublayer A sublayer.
     * @returns The corresponding sublayer extension.
     */
    forSublayer(sublayer: ArcGISSublayer): S;
}
/**
 * Extends the capabilities of an Esri Sublayer object.
 */
export declare abstract class ArcGISSublayerExtension<TProperties extends ArcGISSublayerExtensionProperties = ArcGISSublayerExtensionProperties> extends SublayerExtension<TProperties> {
    get canToggleVisibility(): boolean;
    get supportsSublayers(): boolean;
    get renderer(): RendererUnion;
    /**
     * Whether or not the associate sublayer supports pagination. This affects
     * if we can set maxResults as an option when querying the layer.
     */
    get supportsPagination(): boolean;
    get hasFeatures(): boolean;
    /**
     * The {@link utilities/RequestHelper!RequestHelper} to use when making
     * requests to external services. If not specified, a default implementation
     * will be used.
     */
    get requestHelper(): ArcGISRequestHelper;
    set requestHelper(value: ArcGISRequestHelper);
    get sublayer(): ArcGISSublayer;
    get sublayerExtensions(): ArcGISSublayerExtensionCollection<this>;
    protected get _gdbVersion(): string | undefined;
    private _supportsPagination;
    private _capabilitiesField;
    private _hasAttachments;
    private _requestHelper;
    private _autoCreatedRequestHelper;
    constructor(properties?: TProperties);
    protected _getSerializableProperties(): PropertyDefs<TProperties>;
    /**
     * @inheritDoc
     */
    protected _isSupportedSublayer(sublayer: SublayerLike): boolean;
    protected _getAttachments(feature: Feature): Promise<Attachment[]>;
    protected _getFeatures(ids: string[], options?: FeatureReadOptions): AsyncIterable<Feature>;
    protected _createLayerListSettings(properties?: LayerListSettingsProperties): LayerListSettings;
    protected _createFeatureSettings(): FeatureSettings;
    protected _createRelationships(): Collection<Relationship>;
    /**
     * @inheritDoc
     */
    protected _createRequestHelper(): ArcGISRequestHelper;
    /**
     * @inheritDoc
     */
    protected _createSublayer(properties: ArcGISSublayerProperties): Promise<ArcGISSublayer>;
    protected _createSchema(): Schema;
    /**
     * @inheritDoc
     */
    protected _applySublayerProperties(properties: ArcGISSublayerProperties, sublayer: ArcGISSublayer): Promise<void>;
    protected _capabilities(): QuerySourceCapabilities;
    protected _onInitialize(): Promise<void>;
    protected _postInitialize(): Promise<void>;
    /**
     * @inheritDoc
     */
    protected _serializeSublayer(sublayer: ArcGISSublayer): ArcGISSublayerProperties;
    /**
     * Gets the JSON definition of a sublayer from ArcGIS Server.
     */
    private _getSublayerDefinition;
}
/**
 * Implementation of the
 * {@link support/_ArcGISRelationshipCollection!ArcGISRelationshipCollection}
 * specific to ArcGISSublayer.
 */
export declare class ArcGISSublayerRelationshipCollection extends ArcGISRelationshipCollection {
    /**
     * @inheritDoc
     */
    protected readonly _source: ArcGISSublayerExtension;
    /**
     * @inheritDoc
     */
    protected get _sourceUrl(): string;
    /**
     * @inheritDoc
     */
    protected get _sourceLayerId(): number;
    /**
     * @inheritDoc
     */
    protected _findRelatedSource(relatedLayerId: number): FeatureSource;
}
