export interface OnProviderChange<R, E, I> {
    /**
     * When something goes wrong, e.g. underlying service is not available.
     */
    error?(error: E): void;
    /**
     * Information to display, e.g. due to slow searches, initial message, etc.
     */
    info?(info: I): void;
    /**
     * Notifies if the Resource is not ready and won't respond to searches
     * in a timely manner. Note searches that occur while not ready Will
     * eventually be fulfilled.
     */
    notReady?(): void;
    /**
     * Normal callback on a search result, or updated search result.
     */
    result(result: R): void;
}
/**
 * Defines a typical Resource.
 *
 * Q = query type
 * R = result type
 * E = error type
 * I = info type
 * O = options that filter can accept
 */
export interface Provider<Q, R, E, I, O> {
    /**
     * Results are returned to the OnSearchResult
     * in the subscriber.
     *
     * There may not be a 1-on-1 relationship between a search
     * and a callback.
     *
     * For example, multiple queries may result in one callback if the
     * responses are out of order (i.e. old responses are dropped). Or
     * multiple callbacks may be fired, for example if the underlying data
     * set to search has changed, the last search may be executed again
     * with updated results.
     */
    filter(query?: Q, options?: O): void;
    subscribe(onChange: OnProviderChange<R, E, I>): void;
    unsubscribe(onChange: OnProviderChange<R, E, I>): void;
}
export interface KeyValues {
    [index: string]: any;
}
export interface SecurityOptions {
    headers?: KeyValues;
    omitCredentials?: boolean;
    params?: KeyValues;
}
export declare const buildCredentials: (secOptions?: SecurityOptions) => "omit" | "include";
/**
 * Returns a promise to a SecurityOptions that has just been forcibly refreshed with a
 * new token. Will be used for single retry per request if a 401 is returned.
 */
export interface RefreshSecurityProvider {
    (): Promise<SecurityOptions>;
}
/**
 * Returns the current SecurityOptions for the mentions service.
 */
export interface SecurityProvider {
    (): SecurityOptions;
}
export interface ServiceConfig {
    refreshedSecurityProvider?: RefreshSecurityProvider;
    securityProvider?: SecurityProvider;
    url: string;
}
export interface RequestServiceOptions {
    ignoreResponsePayload?: boolean;
    path?: string;
    queryParams?: KeyValues;
    /**
     * Optional callback invoked with tracing headers extracted from the response.
     * Only exposes x-trace-id and atl-request-id headers.
     */
    reportTracingHeaders?: (headers: Record<string, string>) => void;
    requestInit?: RequestInit;
}
