import type EsriMap from "@arcgis/core/Map";
import Collection from "@arcgis/core/core/Collection";
import type { Feature } from "../../data/Feature.js";
import type { FeatureSource } from "../../data/FeatureSource.js";
import { MapExtension } from "../../mapping/MapExtension.js";
import { InitializableBase } from "../../support/InitializableBase.js";
import type { CountResult } from "../CountResult.js";
import { SearchOptions } from "./SearchOptions.js";
import type { SearchProvider } from "./SearchProvider.js";
import type { SearchSuggestion } from "./SearchSuggestion.js";
/**
 * Allows searching for features by text phrase.
 */
export declare class SearchService extends InitializableBase {
    /**
     * Search providers that implement the search functionality. The collection
     * is initially populated with built-in Geocortex providers, however
     * providers can be added or removed. The order is significant -- the first
     * registered provider that is able to handle a given
     * {@link data/FeatureSource!FeatureSource} will be used for that source (see
     * {@link tasks/search/SearchProvider!SearchProvider.isSupported}).
     */
    readonly providers: Collection<SearchProvider>;
    /**
     * Determines whether this service is able to search the given source, i.e.
     * Whether there is at least one registered provider for that source.
     *
     * @param source The source to check.
     */
    isSupported(source: FeatureSource): boolean;
    /**
     * Searches the given feature sources for features that match a search
     * phrase.
     *
     * @param sources The feature sources to search.
     * @param searchText The text to search for.
     * @param options Options that affect the search.
     * @returns An iterator of {@link data/FeatureSet!FeatureSet} containing
     *   search results. If the search is canceled, the returned iterator might
     *   end prematurely and reject with an instance of
     *   {@link support/Cancellable!Cancellation}, though it may still succeed
     *   and return all results.
     */
    search(sources: Iterable<FeatureSource> | Collection<FeatureSource>, searchText: string, options?: SearchOptions): AsyncIterable<Feature>;
    /**
     * Searches the layers of the given
     * {@link mapping/MapExtension!MapExtension}'s associated map for features
     * that match a search phrase.
     *
     * @param mapExtension The map extension whose map will be searched.
     * @param searchText The text to search for.
     * @param options Options that affect the search.
     * @returns An iterator of {@link data/FeatureSet!FeatureSet} containing
     *   search results. If the search is canceled, the returned iterator might
     *   end prematurely and reject with an instance of
     *   {@link data/FeatureSet!FeatureSet}, though it may still succeed and
     *   return all results.
     */
    search(mapExtension: MapExtension, searchText: string, options?: SearchOptions): AsyncIterable<Feature>;
    /**
     * Searches the layers of the given map for features that match a search
     * phrase.
     *
     * @param map The map to search.
     * @param searchText The text to search for.
     * @param options Options that affect the search.
     * @returns An iterator of {@link data/FeatureSet!FeatureSet} containing
     *   search results. If the search is canceled, the returned iterator might
     *   end prematurely and reject with an instance of
     *   {@link data/FeatureSet!FeatureSet}, though it may still succeed and
     *   return all results.
     */
    search(map: EsriMap, searchText: string, options?: SearchOptions): AsyncIterable<Feature>;
    /**
     * Counts the number of features that match a search phrase in the given
     * feature sources.
     *
     * @param sources The feature sources to search.
     * @param searchText The text to search for.
     * @param options Options that affect the search.
     * @returns An iterator of {@link tasks/CountResult!CountResult} containing
     *   count results. If the search is canceled, the returned iterator might
     *   end prematurely and reject with an instance of
     *   {@link data/FeatureSet!FeatureSet}, though it may still succeed and
     *   return all count results.
     */
    count(sources: Iterable<FeatureSource> | Collection<FeatureSource>, searchText: string, options?: SearchOptions): AsyncIterable<CountResult>;
    /**
     * Counts the number of features that match a search phrase in the layers of
     * the given {@link mapping/MapExtension!MapExtension}'s associated map.
     *
     * @param mapExtension The map extension whose map will be searched.
     * @param searchText The text to search for.
     * @param options Options that affect the search.
     * @returns An iterator of {@link tasks/CountResult!CountResult} containing
     *   count results. If the search is canceled, the returned iterator might
     *   end prematurely and reject with an instance of
     *   {@link data/FeatureSet!FeatureSet}, though it may still succeed and
     *   return all count results.
     */
    count(mapExtension: MapExtension, searchText: string, options?: SearchOptions): AsyncIterable<CountResult>;
    /**
     * Counts the number of features that match a search phrase in the layers of
     * the given map.
     *
     * @param map The map to search.
     * @param searchText The text to search for.
     * @param options Options that affect the search.
     * @returns An iterator of {@link tasks/CountResult!CountResult} containing
     *   count results. If the search is canceled, the returned iterator might
     *   end prematurely and reject with an instance of
     *   {@link data/FeatureSet!FeatureSet}, though it may still succeed and
     *   return all count results.
     */
    count(map: EsriMap, searchText: string, options?: SearchOptions): AsyncIterable<CountResult>;
    /**
     * Provides search suggestions for the given feature sources.
     *
     * @param sources The feature sources to use.
     * @param searchText The text to provide suggestions for.
     * @param options Options that affect the suggest operation.
     * @returns An array of
     *   {@link tasks/search/SearchSuggestion!SearchSuggestion} containing
     *   suggest results. If the suggest is canceled, the returned promise may
     *   be rejected with an instance of {@link data/FeatureSet!FeatureSet}, but
     *   it may still succeed and return results.
     */
    suggest(sources: Iterable<FeatureSource> | Collection<FeatureSource>, searchText: string, options?: SearchOptions): Promise<SearchSuggestion[]>;
    /**
     * Provides search suggestions for the layers of the given
     * {@link mapping/MapExtension!MapExtension}'s associated map.
     *
     * @param mapExtension The map extension that contains the map to use.
     * @param searchText The text to provide suggestions for.
     * @param options Options that affect the suggest operation.
     * @returns An array of
     *   {@link tasks/search/SearchSuggestion!SearchSuggestion} containing
     *   suggest results. If the suggest is canceled, the returned promise may
     *   be rejected with an instance of {@link data/FeatureSet!FeatureSet}, but
     *   it may still succeed and return results.
     */
    suggest(mapExtension: MapExtension, searchText: string, options?: SearchOptions): Promise<SearchSuggestion[]>;
    /**
     * Provides search suggestions for the layers of the given map.
     *
     * @param map The map to use.
     * @param searchText The text to provide suggestions for.
     * @param options Options that affect the suggest operation.
     * @returns An array of
     *   {@link tasks/search/SearchSuggestion!SearchSuggestion} containing
     *   suggest results. If the suggest is canceled, the returned promise may
     *   be rejected with an instance of {@link data/FeatureSet!FeatureSet}, but
     *   it may still succeed and return results.
     */
    suggest(map: EsriMap, searchText: string, options?: SearchOptions): Promise<SearchSuggestion[]>;
    protected _onInitialize(): Promise<void>;
    private _suggest;
}
/**
 * Determines whether a features source should be included by default in search
 * operations.
 *
 * @param source The source to check.
 */
export declare function isSearchable(source: FeatureSource): boolean;
