import Graphic from "@arcgis/core/Graphic";
import Collection from "@arcgis/core/core/Collection";
import type { GeometryUnion } from "@arcgis/core/geometry/types.js";
import type FeatureType from "@arcgis/core/layers/support/FeatureType";
import type { EntityBaseProperties } from "../Entity.js";
import { EntityBase } from "../Entity.js";
import { Hyperlink } from "../Hyperlink.js";
import type { GeometryJson } from "../json/GeometryJson.js";
import type { CancelToken } from "../support/Cancellable.js";
import type { PropertyDefs } from "../support/Serializable.js";
import { type IHandle } from "../support/observableUtils.js";
import { CaseInsensitiveObservableMap } from "../utilities/CaseInsensitiveObservableMap.js";
import { ObservableMap } from "../utilities/ObservableMap.js";
import { ReadOnlyMap } from "../utilities/ReadOnlyMap.js";
import { type FormatOptions as FormatOptionsBase } from "../utilities/format/string.js";
import type { Attachment, AttachmentProperties } from "./Attachment.js";
import type { FeatureSet } from "./FeatureSet.js";
import type { FeatureSettingsProperties } from "./FeatureSettings.js";
import { FeatureSettings } from "./FeatureSettings.js";
import type { FeatureSource } from "./FeatureSource.js";
import type { SchemaProperties } from "./Schema.js";
import { Schema } from "./Schema.js";
import type { Relationship } from "./_Relationship.js";
/**
 * The name of a special attribute that will be added to search or geocode
 * results indicating the strength of the match. Values range from 0 to 100.
 */
export declare const SCORE_FIELD = "_score";
/**
 * Properties that can be passed into the constructor for
 * {@link data/Feature!Feature}.
 */
export interface FeatureProperties extends EntityBaseProperties {
    /**
     * The feature's attributes, keyed by field name.
     */
    attributes?: Map<string, unknown> | Record<string, unknown>;
    /**
     * The feature's geometry.
     */
    geometry?: GeometryUnion | GeometryJson;
    /**
     * Settings for this feature.
     */
    settings?: FeatureSettingsProperties;
    /**
     * Metadata about the feature, such as fields, domains, geometry type, etc.
     */
    schema?: SchemaProperties;
    /**
     * The source of the feature.
     */
    source?: FeatureSource;
}
/**
 * Feature attributes that have been formatted for display.
 */
export interface PresentableAttributes extends ReadOnlyMap<string, string> {
}
/**
 * Settings that affect how the features strings are formatted.
 */
export interface FormatOptions extends FormatOptionsBase {
    /**
     * The default string value for unevaluated expression values. Defaults to
     * an empty string.
     */
    defaultExpressionValue?: string;
}
/**
 * Options that can be used as arguments for the fetchRelatedFeatures()
 * function.
 */
export interface FetchRelatedFeaturesOptions {
    /**
     * @inheritDoc
     */
    cancelToken?: CancelToken;
}
/**
 * Represents a record in a {@link data/FeatureSource!FeatureSource}. Both
 * spatial and non-spatial features have attributes, while only spatial features
 * have geometry.
 */
export declare class Feature extends EntityBase<FeatureProperties> {
    /**
     * The feature's attributes, keyed by field name.
     */
    readonly attributes: CaseInsensitiveObservableMap<unknown>;
    /**
     * The feature's geometry. For non-spatial features, this will be undefined.
     */
    get geometry(): GeometryUnion | undefined;
    set geometry(value: GeometryUnion | undefined);
    /**
     * Settings for this feature.
     */
    readonly settings: FeatureSettings;
    /**
     * Metadata about the feature, such as fields, domains, geometry type, etc.
     */
    readonly schema: Schema;
    /**
     * Attachments associated with this feature. See {@link fetchAttachments}.
     */
    readonly attachments: Collection<Attachment>;
    /**
     * The Expression values associated with this feature. See
     * {@link fetchExpressionInfos}.
     */
    readonly expressionFieldValues: ReadOnlyMap<string, unknown>;
    /**
     * @inheritDoc
     */
    protected readonly _itemType: string;
    /**
     * The type of geometry. This property will be undefined if the data is not
     * spatial.
     */
    get geometryType(): string;
    /**
     * The source of this feature.
     */
    get source(): FeatureSource;
    set source(value: FeatureSource);
    /**
     * The attribute value of the Feature's OBJECTID (oid) field.
     */
    get primaryKey(): string | undefined;
    /**
     * Determines whether this feature has a global ID field.
     */
    get hasGlobalId(): boolean;
    /**
     * Returns the feature's global ID if set and supported by its underlying
     * source. If the feature's source does not support global IDs, then reading
     * this value will return `undefined`, and attempting to set this property
     * will result in an error. Use `hasGlobalId` to check if it's supported.
     */
    get globalId(): string | undefined;
    set globalId(value: string | undefined);
    /**
     * Feature attributes that have been formatted for display. Read-only.
     */
    get presentableAttributes(): PresentableAttributes;
    /**
     * A human readable title for the feature.
     */
    get title(): string;
    /**
     * A human-readable description for the feature.
     */
    get description(): string;
    /**
     * Hyperlinks associated with the feature. Note: This collection is
     * read-only. To change hyperlinks, modify the hyperlinkTemplates setting
     * instead.
     */
    get hyperlinks(): Collection<Hyperlink>;
    /**
     * Gets features that are related to this feature. Returns sets of related
     * features keyed by the relationship that they came from. In order to make
     * related feature available, you must call {@link fetchRelatedFeatures}.
     */
    get relatedFeatures(): ObservableMap<Relationship, FeatureSet>;
    /**
     * The Esri API FeatureType object that is associated with this feature.
     */
    get type(): FeatureType;
    /**
     * Indicates whether attachments have been fetched at least once.
     */
    get attachmentsInitialized(): boolean;
    /**
     * Indicates whether related features have been fetched at least once, if
     * this feature has relationships.
     */
    get relatedFeaturesInitialized(): boolean;
    /**
     * Indicates whether async Arcade expressions have been evaluated at least
     * once.
     */
    get expressionsInitialized(): boolean;
    private get _title();
    private get _description();
    private _geometry;
    private _source;
    private _presentableAttributes;
    private _hyperlinks;
    private _featureHydrationStatus;
    private readonly _relatedFeatures;
    private readonly _expressionFieldValues;
    private _expressionValuesUpdatePending;
    private _attachmentsInitialized;
    private _expressionsInitialized;
    private readonly _initializedRelationships;
    constructor(properties?: FeatureProperties);
    /**
     * Same as {@link utilities/format/string!StringFormatter.format}, except
     * that the format string may also contain field format items, which have
     * this syntax: `{field-name[:format]}`.
     *
     * These items will be substituted with the appropriate field value. Null
     * and undefined values will be converted into empty strings.
     *
     * @param format The format string to use.
     */
    format(format: string, ...args: unknown[]): string;
    /**
     * Same as {@link utilities/format/string!StringFormatter.format}, except
     * that the format string may also contain field format items, which have
     * this syntax: `{field-name[:format]}`.
     *
     * These items will be substituted with the appropriate field value. Null
     * and undefined values will be converted into empty strings.
     */
    format(options: FormatOptions, ...args: unknown[]): string;
    /**
     * Clears the cached values for all "expression info" contained in the
     * PopupTemplate.
     */
    clearExpressionInfos(): void;
    /**
     * Converts the feature to an Esri Graphic object.
     */
    toGraphic(): Graphic;
    /**
     * Fetches or updates the cached values for all "expression infos" contained
     * in the PopupTemplate.
     *
     * @param watch If specified "expression infos" will be reevaluated when the
     *   feature's attributes change.
     */
    fetchExpressionInfos(watch?: boolean): Promise<IHandle | undefined>;
    /**
     * Fetches features that are related to this feature. Features are available
     * through {@link Feature.relatedFeatures}.
     *
     * @param relationships The relationships or relationship IDs to fetch
     *   related features for. If omitted, all related features will be
     *   fetched.
     * @param options Additional options that affect fetching related features.
     */
    fetchRelatedFeatures(relationships?: Relationship | string | (Relationship | string)[], options?: FetchRelatedFeaturesOptions): Promise<void>;
    /**
     * Retrieves attachments that are associated with this feature.
     */
    fetchAttachments(): Promise<void>;
    /**
     * Adds an attachment to the feature. Returns the created Attachment item.
     *
     * @param attachment The attachment to add to the feature.
     */
    addAttachment(attachment: Attachment | AttachmentProperties | File): Promise<Attachment>;
    /**
     * Deletes attachments from the feature.
     *
     * @param attachments The attachments or the ids of the attachments to
     *   delete.
     */
    deleteAttachments(attachments: (Attachment | string)[]): Promise<void>;
    protected _getSerializableProperties(): PropertyDefs<FeatureProperties>;
    protected _onInitialize(): Promise<void>;
    private _findRelationshipIds;
}
/**
 * Creates a {@link data/Feature!Feature} from an Esri Graphic object.
 *
 * @param graphic The graphic.
 * @param properties Initial properties for the feature.
 */
export declare function toFeature(graphic: Graphic, properties?: FeatureProperties): Feature;
/**
 * Creates an Esri Graphic from a {@link data/Feature!Feature} object.
 *
 * @param feature The feature.
 */
export declare function toGraphic(feature: Feature): Graphic;
/**
 * Fetches and resolves all related features for each given feature.
 *
 * @param features The features whose related features will be resolved.
 */
export declare function resolveRelatedFeatures(features: Feature[]): Promise<void>;
