import Collection from "@arcgis/core/core/Collection";
import type SpatialReference from "@arcgis/core/geometry/SpatialReference";
import type FeatureLayer from "@arcgis/core/layers/FeatureLayer";
import type Layer from "@arcgis/core/layers/Layer";
import type Field from "@arcgis/core/layers/support/Field";
import type { WritableKeys } from "ts-essentials";
import { type TableJson } from "../json/TableJson.js";
import type { MapExtension } from "../mapping/MapExtension.js";
import type { PropertyDefs } from "../support/Serializable.js";
import type { GeometryType } from "../support/esri.js";
import { FeatureSettings } from "./FeatureSettings.js";
import type { FeatureSourceBaseProperties } from "./FeatureSourceBase.js";
import { FeatureSourceBase } from "./FeatureSourceBase.js";
import type { QuerySourceCapabilities } from "./QuerySourceCapabilities.js";
import { Schema } from "./Schema.js";
import type { Relationship, RelationshipProperties } from "./_Relationship.js";
import type { TableExtensionFactory } from "./support/TableExtensionFactory.js";
/**
 * Properties that can be passed into the constructor for
 * {@link data/_TableExtension!TableExtension}.
 */
export interface TableExtensionProperties extends FeatureSourceBaseProperties {
    /**
     * See {@link data/_TableExtension!TableExtension.table}.
     */
    table?: FeatureLayer | TableProperties;
    /**
     * See {@link data/_TableExtension!TableExtension.relationships}.
     */
    relationships?: (Relationship | RelationshipProperties)[];
}
/**
 * Properties that can be specified for the
 * {@link data/_TableExtension!TableExtensionProperties.table} property.
 */
export interface TableProperties extends TableJson {
    /**
     * A reference to an existing table, which is the ID or title of the table
     * (or both). In this case, the table extension will attempt to find an
     * existing table instead of creating one.
     */
    $ref?: string | TableReference;
}
/**
 * Matches an existing table in a map.
 */
export interface TableReference {
    /**
     * The table's ID.
     */
    id?: string;
    /**
     * The table's title.
     */
    title?: string;
}
/**
 * Extends the capabilities of an table object (represented by an ArcGIS
 * `FeatureLayer` object).
 */
export declare abstract class TableExtension<TProperties extends TableExtensionProperties = TableExtensionProperties> extends FeatureSourceBase<TProperties> {
    /**
     * The factory that will be used whenever a new table extension needs to be
     * created. Applications can supply their own factory to customize table
     * extension creation.
     */
    static factory: TableExtensionFactory;
    /**
     * The parent map extension.
     */
    get mapExtension(): MapExtension;
    /**
     * The table object being extended.
     */
    get table(): FeatureLayer;
    get capabilities(): QuerySourceCapabilities;
    /**
     * See {@link data/FeatureSource!FeatureSource.title}.
     */
    get title(): string;
    /**
     * Determines whether the type of table being extended supports changing its
     * definition expression.
     */
    get canChangeDefinitionExpression(): boolean;
    /**
     * @inheritDoc
     */
    protected readonly _itemType: string;
    private _table;
    private _mapExtension;
    private _deferredTableProperties;
    private _originalRef;
    constructor(properties?: TProperties);
    /**
     * Creates the appropriate subclass of
     * {@link data/_TableExtension!TableExtension} based on the supplied
     * properties.
     *
     * @param properties The table extension properties.
     */
    static create(properties: TableExtensionProperties): TableExtension;
    protected _getSerializableProperties(): PropertyDefs<TProperties>;
    protected _onInitialize(): Promise<void>;
    /**
     * Determines whether the table is of the right type for the type of table
     * extension.
     *
     * @param table The table to validate.
     */
    protected abstract _isSupportedTable(table: Layer): boolean;
    protected _createSchema(): Schema;
    protected _createFeatureSettings(): FeatureSettings;
    private _setTable;
}
/**
 * An implementation of Schema that directly mirrors the equivalent properties
 * on Table.
 */
export declare class TableSchema extends Schema {
    /**
     * Handle group key for the temporary watch that waits for table to resolve.
     */
    private static readonly _tableResolveWatchKey;
    /**
     * TableExtension that this schema belongs to.
     */
    protected readonly _tableExtension: TableExtension;
    /**
     * Maps schema properties to equivalent properties on the table.
     */
    protected readonly _tableBindings: Map<keyof this, "listMode" | "title" | "url" | "id" | "gdbVersion" | "destroy" | "@eventTypes" | "set" | "emit" | "hasEventListener" | "on" | "addHandles" | "hasHandles" | "removeHandles" | "watch" | "clone" | "fields" | "outFields" | "hasM" | "hasZ" | "popupTemplate" | "labelingInfo" | "renderer" | "opacity" | "spatialReference" | "mode" | "elevationInfo" | "visible" | "refreshInterval" | "labelsVisible" | "maxScale" | "popupEnabled" | "floorInfo" | "source" | "sourceJSON" | "objectIdField" | "geometryType" | "types" | "templates" | "orderBy" | "definitionExpression" | "minScale" | "timeInfo" | "featureReduction" | "globalIdField" | "createPopupTemplate" | "createQuery" | "getField" | "getFieldDomain" | "queryExtent" | "queryFeatureCount" | "queryFeatures" | "queryObjectIds" | "getAtOrigin" | "originOf" | "revertAllToOrigin" | "revertToOrigin" | "isFulfilled" | "isRejected" | "isResolved" | "when" | "cancelLoad" | "load" | "fullExtent" | "parent" | "persistenceEnabled" | "visibilityTimeExtent" | "createLayerView" | "fetchAttributionData" | "customParameters" | "blendMode" | "legendEnabled" | "apiKey" | "save" | "saveAs" | "portalItem" | "copyright" | "layerId" | "effect" | "queryAttributeBins" | "refresh" | "timeExtent" | "timeOffset" | "useViewTime" | "dateFieldsTimeZone" | "displayField" | "historicMoment" | "returnM" | "returnZ" | "displayFilterEnabled" | "displayFilterInfo" | "formTemplate" | "attributeTableTemplate" | "screenSizePerspectiveEnabled" | "trackInfo" | "featureEffect" | "typeIdField" | "editingEnabled" | "addAttachment" | "applyEdits" | "deleteAttachments" | "queryAttachments" | "queryRelatedFeatures" | "queryRelatedFeaturesCount" | "updateAttachment" | "queryTopFeatures" | "charts" | "dynamicDataSource" | "fieldConfigurations" | "createFieldConfigurations" | "getFeatureTitle" | "getFeatureType" | "getFieldAlias" | "getFieldConfiguration" | "queryTopFeatureCount" | "queryTopFeaturesExtent" | "queryTopObjectIds">;
    /**
     * The collection of fields.
     */
    private readonly _fieldCollection;
    constructor(tableExtension: TableExtension);
    destroy(): void;
    get geometryType(): GeometryType;
    set geometryType(value: GeometryType);
    get spatialReference(): SpatialReference;
    set spatialReference(value: SpatialReference);
    protected _hasSettingIncludingAncestor<K extends keyof this>(setting: K): boolean;
    protected _getSetting<K extends keyof this>(setting: K, defaultValue?: this[K]): this[K];
    protected _setSetting<K extends keyof this>(setting: K, value: this[K]): void;
    /**
     * Binds a setting to an equivalent property on the table.
     *
     * @param setting The name of the setting to bind.
     * @param tableProperty The name of the equivalent property on the table, if
     *   it differs from the setting.
     */
    protected _bindSettingToTableProperty(setting: keyof this, tableProperty?: WritableKeys<FeatureLayer>): void;
    /**
     * Invoked as soon as a table is available.
     *
     * @param table The newly resolved table instance.
     */
    protected _onTableResolved(table: FeatureLayer): void;
    /**
     * Creates the backing collection for fields.
     */
    protected _createFieldCollection(): Collection<Field>;
}
/**
 * Implementation of feature settings that is read-only for geometry related
 * settings.
 */
export declare class TableFeatureSettings extends FeatureSettings {
    get returnGeometry(): boolean;
    set returnGeometry(value: boolean);
    get outSpatialReference(): SpatialReference;
    set outSpatialReference(value: SpatialReference);
    get maxAllowableOffset(): number;
    set maxAllowableOffset(value: number);
    get zoomScale(): number;
    set zoomScale(value: number);
    get zoomFactor(): number;
    set zoomFactor(value: number);
}
