import type { Feature } from "../../data/Feature.js";
import type { FeatureSource } from "../../data/FeatureSource.js";
import type { CountResult } from "../CountResult.js";
import type { SearchOptions } from "./SearchOptions.js";
import type { SearchSuggestion } from "./SearchSuggestion.js";
/**
 * Provides search capability for one or more
 * {@link data/FeatureSource!FeatureSource}s.
 */
export interface SearchProvider {
    /**
     * Determines whether this provider can handle searches for the given
     * feature source.
     *
     * @param source The feature source.
     */
    isSupported(source: FeatureSource): boolean;
    /**
     * Searches a given feature source for features that match a search phrase.
     *
     * @param source The source to search.
     * @param searchText The text to search for.
     * @param options Options that affect the search.
     * @returns An iterator of {@link data/Feature!Feature}s containing search
     *   results. If the search is canceled, the provider may reject the
     *   returned promise with an instance of
     *   {@link support/Cancellable!Cancellation}, though it may still fulfill
     *   with search results instead.
     */
    search(source: FeatureSource | FeatureSource[], searchText: string, options?: SearchOptions): AsyncIterable<Feature>;
    /**
     * Suggests matching phrases to search for based on some input text.
     *
     * @param source The source to search.
     * @param searchText The text to search for.
     * @param options Options that affect the search.
     * @returns A list of suggestions.
     */
    suggest(source: FeatureSource | FeatureSource[], searchText: string, options?: SearchOptions): Promise<SearchSuggestion[]>;
    /**
     * Searches a given feature source for features that match a search phrase
     * and returns a count of matching features.
     *
     * @param source The source to search.
     * @param searchText The text to search for.
     * @param options Options that affect the search.
     * @returns An iterator of {@link tasks/CountResult!CountResult}s containing
     *   a count of matching features. If the search is canceled, the provider
     *   may reject the returned promise with an instance of
     *   {@link support/Cancellable!Cancellation}, though it may still fulfill
     *   with count results instead.
     */
    count(source: FeatureSource | FeatureSource[], searchText: string, options?: SearchOptions): Promise<CountResult[]>;
}
