import React from 'react'; import { ChannelOrUserResponse } from '../utils'; import type { ChannelFilters, ChannelOptions, ChannelSort, UserFilters, UserOptions, UserSort } from 'stream-chat'; import type { Channel } from 'stream-chat'; import type { SearchBarController } from '../SearchBar'; import type { SearchInputController } from '../SearchInput'; import type { SearchResultsController } from '../SearchResults'; import type { DefaultStreamChatGenerics } from '../../../types/types'; export declare type ChannelSearchFunctionParams = { setQuery: React.Dispatch>; setResults: React.Dispatch[]>>; setSearching: React.Dispatch>; }; export declare type SearchController = SearchInputController & SearchBarController & SearchResultsController; export declare type SearchQueryParams = { channelFilters?: { filters?: ChannelFilters; options?: ChannelOptions; sort?: ChannelSort; }; userFilters?: { filters?: UserFilters; options?: UserOptions; sort?: UserSort; }; }; export declare type ChannelSearchParams = { /** The type of channel to create on user result select, defaults to `messaging` */ channelType?: string; /** Clear search state / results on every click outside the search input, defaults to true */ clearSearchOnClickOutside?: boolean; /** Disables execution of the search queries, defaults to false */ disabled?: boolean; /** Callback invoked with every search input change handler */ onSearch?: SearchInputController['onSearch']; /** Callback invoked when the search UI is deactivated */ onSearchExit?: () => void; /** Custom handler function to run on search result item selection */ onSelectResult?: (params: ChannelSearchFunctionParams, result: ChannelOrUserResponse) => Promise | void; /** Boolean to search for channels as well as users in the server query, default is false and just searches for users */ searchForChannels?: boolean; /** Custom search function to override the default implementation */ searchFunction?: (params: ChannelSearchFunctionParams, event: React.BaseSyntheticEvent) => Promise | void; /** Object containing filters/sort/options overrides for user / channel search */ searchQueryParams?: SearchQueryParams; }; export declare type ChannelSearchControllerParams = ChannelSearchParams & { /** Set the array of channels displayed in the ChannelList */ setChannels: React.Dispatch>>>; }; export declare const useChannelSearch: ({ channelType, clearSearchOnClickOutside, disabled, onSearch: onSearchCallback, onSearchExit, onSelectResult, searchForChannels, searchFunction, searchQueryParams, setChannels, }: ChannelSearchControllerParams) => SearchController; //# sourceMappingURL=useChannelSearch.d.ts.map