import type Collection from "@arcgis/core/core/Collection";
import type Extent from "@arcgis/core/geometry/Extent";
import type { Entity } from "../Entity.js";
import type { Hyperlink, HyperlinkProperties } from "../Hyperlink.js";
import type { Menu } from "../menus/Menu.js";
import type { Action } from "../support/Action.js";
import type { CancelToken } from "../support/Cancellable.js";
import type { Initializable } from "../support/InitializableBase.js";
import type { QueryService } from "../tasks/query/QueryService.js";
import type { Attachment, AttachmentProperties } from "./Attachment.js";
import type { Capabilities } from "./Capabilities.js";
import type { Feature } from "./Feature.js";
import type { FeatureSettings, FeatureSettingsProperties } from "./FeatureSettings.js";
import type { Schema, SchemaProperties } from "./Schema.js";
import type { TaskSettings, TaskSettingsProperties } from "./TaskSettings.js";
import type { Relationship, RelationshipProperties } from "./_Relationship.js";
/**
 * Properties that can be specified when creating a
 * {@link data/FeatureSource!FeatureSource}.
 */
export interface FeatureSourceProperties {
    /**
     * See {@link data/FeatureSource!FeatureSource.attachmentTypes}.
     */
    attachmentTypes?: string[];
    /**
     * See {@link data/FeatureSource!FeatureSource.featureSettings}.
     */
    featureSettings?: FeatureSettingsProperties;
    /**
     * See {@link data/FeatureSource!FeatureSource.hyperlinks}.
     */
    hyperlinks?: (Hyperlink | HyperlinkProperties)[];
    /**
     * See {@link data/FeatureSource!FeatureSource.iconUrl}.
     */
    iconUrl?: string;
    /**
     * See {@link data/FeatureSource!FeatureSource.onAddFeature}.
     */
    onAddFeature?: Action;
    /**
     * See {@link data/FeatureSource!FeatureSource.onEditFeature}.
     */
    onEditFeature?: Action;
    /**
     * See {@link data/FeatureSource!FeatureSource.relationships}.
     */
    relationships?: (Relationship | RelationshipProperties)[];
    /**
     * See {@link data/FeatureSource!FeatureSource.schema}.
     */
    schema?: SchemaProperties;
    /**
     * See {@link data/FeatureSource!FeatureSource.taskSettings}.
     */
    taskSettings?: TaskSettingsProperties;
}
/**
 * A source of features.
 */
export interface FeatureSource extends Entity, Initializable {
    /**
     * A list of the valid file MIME types that can be uploaded as attachments.
     */
    attachmentTypes?: string[];
    /**
     * The action to be executed when a feature is added.
     */
    onAddFeature?: Action;
    /**
     * The action to be executed when a feature is edited.
     */
    onEditFeature?: Action;
    /**
     * Default settings that apply to features originating from this source.
     */
    readonly featureSettings: FeatureSettings;
    /**
     * Settings that affect whether a feature source participates in various
     * tasks that are performed on a map.
     */
    readonly taskSettings: TaskSettings;
    /**
     * Metadata about features originating from this source, such as fields,
     * domains, and geometry type.
     */
    readonly schema: Schema;
    /**
     * Relationships to other feature sources.
     */
    readonly relationships: Collection<Relationship>;
    /**
     * Hyperlinks associated with the feature source.
     */
    readonly hyperlinks: Collection<Hyperlink>;
    /**
     * Capabilities of the feature source.
     */
    readonly capabilities: Capabilities;
    /**
     * A human readable title for the feature source.
     */
    readonly title: string;
    /**
     * A menu for actions specifically related to features from this source.
     */
    featureActions?: Menu;
    /**
     * A menu for actions specifically related to this source.
     */
    featureSourceActions?: Menu;
    /**
     * URL to an icon that represents this feature source.
     */
    iconUrl?: string;
    /**
     * An optional query service that the feature source can use to get
     * features.
     */
    queryService?: QueryService;
    /**
     * Adds an attachment to a feature.
     *
     * @param feature The feature to add the attachment to.
     * @param attachment The attachment to add to the feature.
     */
    addAttachment(feature: Feature, attachment: Attachment | AttachmentProperties | File): Promise<Attachment>;
    /**
     * Deletes attachments from a feature.
     *
     * @param feature The feature to delete attachments from.
     * @param attachments The attachments or the IDs of the attachments to
     *   delete from the feature.
     */
    deleteAttachments(feature: Feature, attachments: (Attachment | string)[]): Promise<void>;
    /**
     * Gets any attachments associated with a feature.
     *
     * @param feature The feature to get attachments for.
     */
    getAttachments(feature: Feature): Promise<Attachment[]>;
    /**
     * Gets a feature by ID. If no such feature exists, the promise is rejected
     * with an instance of NotFoundError.
     *
     * @param id The ID of the feature to retrieve.
     * @param options Additional options that control how the feature is
     *   retrieved.
     */
    getFeature(id: string, options?: FeatureReadOptions): Promise<Feature>;
    /**
     * Gets a set of features by their IDs.
     *
     * @param ids The IDs of the features to retrieve.
     * @param options Additional Options that control how the features are
     *   retrieved.
     */
    getFeatures(ids: string[], options?: FeatureReadOptions): AsyncIterable<Feature>;
    /**
     * Adds a new feature to the source. If the source does not support adding
     * features, then an {@link InvalidOperationError} will be thrown (see
     * {@link capabilities}).
     *
     * @param feature The feature to add.
     * @param options Additional options that control how the feature is saved.
     */
    addFeature(feature: Feature, options?: FeatureWriteOptions): Promise<void>;
    /**
     * Adds a set of features to the source. If the source does not support
     * adding features, then an {@link InvalidOperationError} will be thrown (see
     * {@link capabilities}).
     *
     * @param features The features to add.
     * @param options Additional options that control how the features are
     *   saved.
     */
    addFeatures(features: Iterable<Feature>, options?: FeatureWriteOptions): Promise<void>;
    /**
     * Saves changes to an existing feature. If the source does not support
     * updating features, then an {@link InvalidOperationError} will be thrown
     * (see {@link capabilities}).
     *
     * @param feature The feature to update.
     * @param options Additional options that control how the feature is saved.
     */
    updateFeature(feature: Feature, options?: FeatureWriteOptions): Promise<void>;
    /**
     * Saves changes to a existing features. If the source does not support
     * updating features, then an {@link InvalidOperationError} will be thrown
     * (see {@link capabilities}).
     *
     * @param features The features to update.
     * @param options Additional options that control how the features are
     *   saved.
     */
    updateFeatures(features: Iterable<Feature>, options?: FeatureWriteOptions): Promise<void>;
    /**
     * Deletes a feature from its source. If the source does not support
     * deleting features, then an {@link InvalidOperationError} will be thrown
     * (see {@link capabilities}).
     *
     * @param id The ID of the feature to delete.
     * @param options Additional options that control how the features are
     *   deleted.
     */
    deleteFeature(id: string, options?: FeatureWriteOptions): Promise<void>;
    /**
     * Deletes a feature from its source. If the source does not support
     * deleting features, then an {@link InvalidOperationError} will be thrown
     * (see {@link capabilities}).
     *
     * @param feature The feature to delete.
     * @param options Additional options that control how the features are
     *   deleted.
     */
    deleteFeature(feature: Feature, options?: FeatureWriteOptions): Promise<void>;
    /**
     * Deletes features from their source. If the source does not support
     * deleting features, then an {@link InvalidOperationError} will be thrown
     * (see {@link capabilities}).
     *
     * @param ids The IDs of the features to delete.
     * @param options Additional options that control how the features are
     *   deleted.
     */
    deleteFeatures(ids: string[], options?: FeatureWriteOptions): Promise<void>;
    /**
     * Deletes features from their source. If the source does not support
     * deleting features, then an {@link InvalidOperationError} will be thrown
     * (see {@link capabilities}).
     *
     * @param features The features to delete.
     * @param options Additional options that control how the features are
     *   deleted.
     */
    deleteFeatures(features: Iterable<Feature>, options?: FeatureWriteOptions): Promise<void>;
    /**
     * Returns the full extent of the source that contains all included
     * features.
     */
    getFullExtent(): Extent | undefined;
}
/**
 * Options that can be passed into the various methods of
 * {@link data/FeatureSource!FeatureSource} that retrieve features.
 */
export interface FeatureReadOptions {
    /**
     * An optional cancel token from a {@link support/Cancellable!Cancellable}
     * that can be used to cancel the read operation.
     */
    cancelToken?: CancelToken;
    /**
     * Whether geometry for features should be returned.
     */
    returnGeometry?: boolean;
    /**
     * Fields that should be returned for each feature.
     */
    outFields?: string[];
}
export declare namespace FeatureReadOptions {
    /**
     * Default values for {@link FeatureReadOptions}.
     */
    const DEFAULTS: FeatureReadOptions;
    /**
     * Gets default read options configured in a
     * {@link data/FeatureSource!FeatureSource}.
     *
     * @param source The feature source.
     */
    function fromFeatureSource(source: FeatureSource): FeatureReadOptions;
}
/**
 * Options that can be passed into the various feature editing methods of
 * {@link data/FeatureSource!FeatureSource}.
 */
export interface FeatureWriteOptions {
    /**
     * An optional cancel token from a {@link support/Cancellable!Cancellable}
     * that can be used to cancel the save operation. Note that calling
     * {@link support/Cancellable!Cancellable.cancel} will NOT undo changes that
     * have already been successfully applied.
     */
    cancelToken?: CancelToken;
}
