import * as React from 'react';
import { Events, PropertyChange } from '../../coreUtils/events';
export interface SearchInputProps {
    className?: string;
    inputProps?: React.HTMLProps<HTMLInputElement>;
    store: SearchInputStore;
    children?: React.ReactNode;
}
export declare function SearchInput(props: SearchInputProps): import("react/jsx-runtime").JSX.Element;
/**
 * Options for {@link useSearchInputStore} hook.
 *
 * @see {@link useSearchInputStore}
 */
export interface UseSearchInputStoreOptions<T> {
    /**
     * Initial value for the search state.
     */
    initialValue: T;
    /**
     * Submit timeout after input to submit the value for the search:
     *  - `(number)`: debounce time in milliseconds;
     *  - `immediate`: submit immediately after input;
     *  - `explicit`: submit only on explicit action.
     *
     * @default "immediate"
     */
    submitTimeout?: number | 'immediate' | 'explicit';
    /**
     * Validates whether the search value can be submitted,
     * e.g. the search term is at least some characters long.
     */
    allowSubmit?: (value: T) => boolean;
}
/**
 * Represents the state store for an abstract search input component.
 *
 * @see {@link useSearchInputStore}
 */
export interface SearchInputStore<T = string> {
    /**
     * Events for the search store.
     */
    readonly events: Events<SearchInputStoreEvents<T>>;
    /**
     * Current submit mode for the `input` value changes in the store:
     *  - `debounce`: submit after debounce timeout;
     *  - `immediate`: submit immediately after input;
     *  - `explicit`: submit only on explicit `submit` action.
     */
    get mode(): 'debounce' | 'immediate' | 'explicit';
    /**
     * Current search query value.
     */
    get value(): T;
    /**
     * Changes the search query value with specified intent (action).
     */
    change(params: {
        /**
         * New search query value.
         */
        value: T;
        /**
         * Change intent (action):
         *  - `input`: potentially transient change to the query value,
         *    likely to be superseded by another;
         *  - `submit`: explicit request to perform the search immediately;
         *  - `clear`: explicit or implicit request to clear the search query
         *    e.g. via specific button or if a new value is not allowed to
         *    be submitted.
         */
        action: 'input' | 'submit' | 'clear';
    }): void;
}
/**
 * Events date for {@link SearchInputStore} events.
 *
 * @see {@link SearchInputStore}
 */
export interface SearchInputStoreEvents<T> {
    /**
     * Triggered on {@link SearchInputStore.value} property change.
     */
    changeValue: SearchInputStoreChangeValueEvent<T>;
    /**
     * Triggered on {@link SearchInputStore.mode} property change.
     */
    changeMode: PropertyChange<SearchInputStore<T>, SearchInputStore['mode']>;
    /**
     * Triggered on a request to perform the search, either after debounce
     * timeout since last value change with `input` action or explicit
     * `submit` value change.
     */
    executeSearch: {
        /**
         * Event source (search input store).
         */
        readonly source: SearchInputStore<T>;
        /**
         * Current search query value.
         */
        readonly value: T;
    };
    /**
     * Triggered on a request to clear the search query, either after
     * value change with `clear` action or when submitted value does
     * not pass the validation.
     */
    clearSearch: {
        /**
         * Event source (search input store).
         */
        readonly source: SearchInputStore<T>;
        /**
         * Current search query value.
         */
        readonly value: T;
    };
}
/**
 * Event data for search query value change event.
 */
export interface SearchInputStoreChangeValueEvent<T> extends PropertyChange<SearchInputStore<T>, T> {
    /**
     * Search query value change intent (action).
     *
     * @see {@link SearchInputStore.change}
     */
    readonly action: 'input' | 'submit' | 'clear';
}
/**
 * React hook to create a search input state store with debounce support.
 *
 * **Experimental**: this feature are likely to change in the future.
 *
 * @returns stable {@link SearchInputStore} instance which will not change on re-renders
 *
 * @category Hooks
 */
export declare function useSearchInputStore<T = string>(params: UseSearchInputStoreOptions<T>): SearchInputStore<T>;
//# sourceMappingURL=searchInput.d.ts.map