import type Geometry from "@arcgis/core/geometry/Geometry";
import type Point from "@arcgis/core/geometry/Point";
import type SpatialReference from "@arcgis/core/geometry/SpatialReference";
import type { Capabilities } from "../../data/Capabilities.js";
import type { Feature } from "../../data/Feature.js";
import type { FeatureSet } from "../../data/FeatureSet.js";
import type { FeatureReadOptions, FeatureSource, FeatureWriteOptions } from "../../data/FeatureSource.js";
import type { FeatureSourceBaseProperties } from "../../data/FeatureSourceBase.js";
import { FeatureSourceBase } from "../../data/FeatureSourceBase.js";
import type { SchemaProperties } from "../../data/Schema.js";
import { Schema } from "../../data/Schema.js";
import type { CancelToken } from "../../support/Cancellable.js";
import type { PropertyDefs } from "../../support/Serializable.js";
import type { CountResult } from "../CountResult.js";
/**
 * The name of the field that will contain the matched address in batch geocode
 * results.
 */
export declare const ADDRESS_FIELD = "_address";
/**
 * A type that can be a string, feature or JSON object representing an address.
 */
export type AddressLike = string | Feature | Record<string, unknown>;
/**
 * Properties that can be passed into the constructor for
 * {@link tasks/geocoding/Geocoder!Geocoder}.
 */
export interface GeocoderProperties extends FeatureSourceBaseProperties {
    /**
     * See {@link tasks/geocoding/Geocoder!Geocoder.title}.
     */
    title?: string;
    /**
     * See {@link tasks/geocoding/Geocoder!Geocoder.addressSchema}.
     */
    addressSchema?: SchemaProperties;
    /**
     * See {@link tasks/geocoding/Geocoder!Geocoder.defaultAddressValues}.
     */
    defaultAddressValues?: Record<string, unknown>;
}
/**
 * A geocoder (service that can lookup features by address).
 */
export declare abstract class Geocoder<TProperties extends GeocoderProperties = GeocoderProperties> extends FeatureSourceBase<TProperties> {
    /**
     * See {@link data/FeatureSource!FeatureSource.title}.
     */
    title: string;
    /**
     * The schema that defines the input address fields.
     */
    readonly addressSchema: Schema;
    /**
     * Default address field values to use when they are missing in the input
     * address. For instance, if a geocoder has a "City" input field, then
     * setting its default value to "Victoria" would cause the geocoder to
     * search for addresses within the city of Victoria by default if no city is
     * specified.
     */
    readonly defaultAddressValues: Map<string, unknown>;
    get capabilities(): GeocoderCapabilities;
    /**
     * @inheritDoc
     */
    protected readonly _itemType: string;
    /**
     * The default capabilities for a geocoder.
     */
    protected _capabilitiesInternal: GeocoderCapabilities;
    constructor(properties?: TProperties);
    /**
     * Finds one or more locations corresponding to an address.
     *
     * @param address The address to search for. Can either be a string like
     *   "123 Sesame Street", or a feature or JSON object representing an
     *   address. In the latter case, the address field names and types
     *   understood by the geocoder are defined by the {@link addressSchema}
     *   property. Only the attributes are used -- any geometry on the input
     *   feature is ignored.
     * @param options Options that affect how the search is performed.
     * @returns A set of features representing candidate matches for the
     *   address. In addition to its normal attributes, each feature will have a
     *   special {@link data/Feature!SCORE_FIELD} attribute which is a number
     *   from 0 to 100 indicating a level of confidence in the match.
     */
    abstract geocode(address: AddressLike, options?: GeocodeOptions): AsyncIterable<Feature>;
    /**
     * Counts the number of locations corresponding to an address.
     *
     * @param address The address to search for. Can either be a string like
     *   "123 Sesame Street", or a feature or JSON object representing an
     *   address. In the latter case, the address field names and types
     *   understood by the geocoder are defined by the {@link addressSchema}
     *   property. Only the attributes are used -- any geometry on the input
     *   feature is ignored.
     * @param options Options that affect how the search is performed.
     * @returns A count resulting indicating the number of candidate matches for
     *   the address.
     */
    abstract count(address: AddressLike, options?: GeocodeOptions): Promise<CountResult>;
    /**
     * Finds locations corresponding to multiple addresses. The geocoder must
     * have the supportsBatchGeocoding capability (see {@link capabilities}).
     *
     * @param addresses The addresses to search for. Can either be a string like
     *   "123 Sesame Street", or a feature or JSON object representing an
     *   address. In the latter case, the address field names and types
     *   understood by the geocoder are defined by the {@link addressSchema}
     *   property. Only the attributes are used -- any geometries on input
     *   features are ignored.
     * @param options Options that affect how the search is performed.
     * @returns A set of features representing a candidate matches for each
     *   address. In addition to its normal attributes, each feature will have a
     *   special {@link data/Feature!SCORE_FIELD} attribute which is a number
     *   from 0 to 100 indicating a level of confidence in the match. It will
     *   also have a special {@link tasks/geocoding/Geocoder!ADDRESS_FIELD}
     *   attribute which is the input address that it matches.
     */
    abstract batchGeocode(addresses: AddressLike[], options?: GeocodeOptions): AsyncIterable<Feature>;
    /**
     * Suggests matching addresses to search for based on some input text. The
     * geocoder must have the supportsSuggest capability (see
     * {@link capabilities}).
     *
     * @param searchText The input text to search for.
     * @param options Options that affect how the search is performed.
     * @returns A list of formatted address suggestions.
     */
    abstract suggest(searchText: string, options?: GeocodeOptions): Promise<string[]>;
    /**
     * Finds the address at a particular location. The geocoder must have the
     * supportsReverseGeocoding capability (see {@link capabilities}).
     *
     * @param location The location to search for.
     * @param options Options that affect how the search is performed.
     * @returns A feature representing the address at the given location, or
     *   undefined if there is no match.
     */
    abstract reverseGeocode(location: Point, options?: GeocodeOptions): Promise<Feature | undefined>;
    getFeature(id: string, options?: FeatureReadOptions): Promise<Feature>;
    getFeatures(ids: string[], options?: FeatureReadOptions): AsyncIterable<Feature>;
    addFeature(feature: Feature, options?: FeatureWriteOptions): Promise<void>;
    addFeatures(features: FeatureSet, options?: FeatureWriteOptions): Promise<void>;
    updateFeature(feature: Feature, options?: FeatureWriteOptions): Promise<void>;
    updateFeatures(features: FeatureSet, options?: FeatureWriteOptions): Promise<void>;
    deleteFeature(id: string, options?: FeatureWriteOptions): Promise<void>;
    deleteFeature(feature: Feature, options?: FeatureWriteOptions): Promise<void>;
    deleteFeatures(ids: string[], options?: FeatureWriteOptions): Promise<void>;
    deleteFeatures(features: FeatureSet, options?: FeatureWriteOptions): Promise<void>;
    protected _getSerializableProperties(): PropertyDefs<TProperties>;
    /**
     * Called to create the {@link data/Schema!Schema} representing the input
     * address.
     */
    protected _createAddressSchema(): Schema;
    protected _capabilities(): GeocoderCapabilities;
}
/**
 * Options that can be passed into geocode operations.
 */
export interface GeocodeOptions {
    /**
     * An optional cancel token from a {@link support/Cancellable!Cancellable}
     * that can be used to cancel the geocode operation.
     */
    cancelToken?: CancelToken;
    /**
     * If specified, results will be weighted for the specified point. No effect
     * for reverse geocoding.
     */
    searchPoint?: Point;
    /**
     * If specified, results will be limited to those that intersect the given
     * geometry. No effect for reverse geocoding.
     */
    searchArea?: Geometry;
    /**
     * The maximum number of results to return. This cannot exceed the maximum
     * supported by the geocoder (see
     * {@link tasks/geocoding/Geocoder!Geocoder.capabilities}).
     */
    maxResults?: number;
    /**
     * Fields that should be returned for each feature.
     */
    outFields?: string[];
    /**
     * The spatial reference of the results.
     */
    outSpatialReference?: SpatialReference;
}
export declare namespace GeocodeOptions {
    /**
     * Default values for {@link GeocodeOptions}.
     */
    const DEFAULTS: GeocodeOptions;
    /**
     * Gets default search options configured in a
     * {@link data/FeatureSource!FeatureSource}.
     *
     * @param source The feature source.
     */
    function fromFeatureSource(source: FeatureSource): GeocodeOptions;
}
/**
 * The capabilities of a {@link tasks/geocoding/Geocoder!Geocoder}.
 */
export interface GeocoderCapabilities extends Capabilities {
    /**
     * Indicates whether the geocode operation supports the batchGeocode
     * operation.
     */
    readonly supportsBatch: boolean;
    /**
     * Indicates whether the geocode operation supports the reverseGeocode
     * operation.
     */
    readonly supportsReverse: boolean;
    /**
     * Indicates whether the geocode operation supports the suggest operation.
     */
    readonly supportsSuggest: boolean;
    /**
     * The maximum number of results that can be returned from geocode
     * operations.
     */
    readonly maxResults: number;
}
