import * as React from 'react';
import { Events } from '../../coreUtils/events';
import { SearchInputStore, SearchInputStoreEvents } from '../utility/searchInput';
export interface UnifiedSearchSectionContext {
    readonly searchStore: ExternalSearchStore;
    readonly isSectionActive: boolean;
    readonly setSectionActive: (active: boolean, searchExtra?: object) => void;
}
export interface ExternalSearchStore extends Pick<SearchInputStore, 'value' | 'change'> {
    readonly events: Events<Pick<SearchInputStoreEvents<string>, 'changeValue'>>;
}
export declare const UnifiedSearchSectionContext: React.Context<UnifiedSearchSectionContext | null>;
/**
 * Options for {@link useUnifiedSearchSection} hook.
 *
 * @see {@link useUnifiedSearchSection}
 */
export interface UseUnifiedSearchSectionOptions {
    /**
     * Debounce timeout in milliseconds after input to perform the text search.
     *
     * @default 0
     */
    searchTimeout?: number;
    /**
     * Validates whether the search value can be submitted,
     * e.g. the search term is at least some characters long.
     */
    allowSubmit?: (term: string) => boolean;
}
/**
 * Search context provided for its section.
 *
 * @see {@link useUnifiedSearchSection}
 */
export interface UnifiedSearchSectionProvidedContext {
    /**
     * Whether this section must be rendered because its opened the first time.
     *
     * This is useful for optimization purpose to allow lazy-loading for the section content.
     */
    readonly shouldRender: boolean;
    /**
     * Whether this section is active (displayed to the user).
     */
    readonly isSectionActive: boolean;
    /**
     * Requests the search to activate or deactivate this section.
     *
     * @param searchExtra Additional search request data to mark that this section
     * displays search result with additional restrictions, so the request should not
     * be assumed empty even if there is no search term.
     */
    readonly setSectionActive: (active: boolean, searchExtra?: object) => void;
    /**
     * Controlled state store for the search input in this section.
     */
    readonly searchStore: SearchInputStore;
}
/**
 * React hook to get provided search context for the current section.
 *
 * Throws an error if called from a non-mounted or non-section component.
 *
 * @category Hooks
 */
export declare function useUnifiedSearchSection(props?: UseUnifiedSearchSectionOptions): UnifiedSearchSectionProvidedContext;
//# sourceMappingURL=searchSection.d.ts.map