mirror of
https://github.com/flarum/core.git
synced 2025-08-07 08:56:38 +02:00
31 lines
919 B
TypeScript
31 lines
919 B
TypeScript
export default class SearchState {
|
|
protected cachedSearches: Set<string>;
|
|
protected value: string;
|
|
constructor(cachedSearches?: string[]);
|
|
/**
|
|
* If we are displaying the full results of a search (not just a preview),
|
|
* this value should return the query that prompted that search.
|
|
*
|
|
* In this generic class, full page searching is not supported.
|
|
* This method should be implemented by subclasses that do support it.
|
|
*
|
|
* @see Search
|
|
*/
|
|
getInitialSearch(): string;
|
|
getValue(): string;
|
|
setValue(value: string): void;
|
|
/**
|
|
* Clear the search value.
|
|
*/
|
|
clear(): void;
|
|
/**
|
|
* Mark that we have already searched for this query so that we don't
|
|
* have to ping the endpoint again.
|
|
*/
|
|
cache(query: string): void;
|
|
/**
|
|
* Check if this query has been searched before.
|
|
*/
|
|
isCached(query: string): boolean;
|
|
}
|